Automatically open on page load

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Automatically open on page load

trentb
Is there a way to automatically open a shadowbox window when the page loads? I am using JQuery, thanks for your help.
Reply | Threaded
Open this post in threaded view
|

Re: Automatically open on page load

mjijackson
Administrator
$(document).ready(function(){
    Shadowbox.init();
    Shadowbox.open( ... );
});
Reply | Threaded
Open this post in threaded view
|

Re: Automatically open on page load

kre8-ive
Michael,

Can you explain this a bit more? I've tried adding the script you supplied but it doesn't seem to work. Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: Automatically open on page load

kre8-ive
Never mind - figured it out.
Reply | Threaded
Open this post in threaded view
|

Re: Automatically open on page load

Stephan
Could you please explain how you did it, or just copy the whole script u used so that i can figure it out, thanks
Reply | Threaded
Open this post in threaded view
|

Re: Automatically open on page load

Andrew
In reply to this post by mjijackson
Where do you add this code?

I am also trying to open an image or HTML page using shadowbox when the page loads...

$(document).ready(function(){
    Shadowbox.init();
    Shadowbox.open( ... );
});

I am working on BBQOUTFITTERS.COM

Andrew
Reply | Threaded
Open this post in threaded view
|

Re: Automatically open on page load

arttronics
This method requires the jQuery JavaScript library.

Add this code above the </head> tag so it's the last item and specify Shadowbox.init early on:

      <script type="text/javascript">

           window.onload = function() {
               
               $(document).ready(function(){
                 Shadowbox.open({
                           content: 'file.swf',
                           player:  "swf",
                           title:   'Welcome Screen jQuery Onload - ESC to Exit.',
                           width:   500,
                           height:  500,
                           options: {
                                   displayNav:      false,
                                   modal:           true
                           }
                 });
               }); 
           };

      </script>


Here is a version for use without jQuery:

      <script type="text/javascript">

           window.onload = function() {

                 Shadowbox.open({
                           content: 'file.swf',
                           player:  "swf",
                           title:   'Welcome Screen Onload - ESC to Exit.',
                           width:   500,
                           height:  500,
                           options: {
                                   displayNav:      false,
                                   modal:           true
                           }
                 });

           };

      </script>


Change the contents and player and etc to your needs.

When posting your markup here on the forum follow these simple steps:

0. Login and paste your markup into the Message Box.
1. Mouse select the markup you just pasted.
2. Press the More Button from the Message Box Toolbar.
3. Select Raw text from the drop down menu. DONE!

If I don't respond to your POST, it's your inability to provide your markup correctly.

Check out a few DEMOS I made that are here in this forum.

Reply | Threaded
Open this post in threaded view
|

Re: Automatically open on page load

PearcePaton
arttonics,

Could you go into more detail for me on the page load shadow box.

I am using

<script type="text/javascript"> window.onload = function() { Shadowbox.open({ content: 'file.swf', player: "swf", title: 'ESC to Exit, Click "HD"', width: 900, height: 506, overlayOpacity: 0.9, options: { displayNav: false, modal: true } }); }; </script>

Which is working however I want to embed a Vimeo video into this shadow box.


<iframe src="http://player.vimeo.com/video/36748701?title=0&amp;byline=0&amp;portrait=0&amp;color=ed4a68&amp;autoplay=1" width="900" height="506" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>


I am in over my head and am wondering if you could put these together to make them work. Thanks
Reply | Threaded
Open this post in threaded view
|

Re: Automatically open on page load

arttronics
This post was updated on .
For example, the content should be:
content: 'http://player.vimeo.com/video/36748701',

The player should be changed from swf to iframe instead.
player: 'iframe',

EDIT: Cleaned up examples to be more clear.

When posting your markup here on the forum follow these simple steps:

0. Login and paste your markup into the Message Box.
1. Mouse select the markup you just pasted.
2. Press the More Button from the Message Box Toolbar.
3. Select Raw text from the drop down menu. DONE!

If I don't respond to your POST, it's your inability to provide your markup correctly.

Check out a few DEMOS I made that are here in this forum.

Reply | Threaded
Open this post in threaded view
|

Re: Automatically open on page load

Wally Rodriguez
So following these examples, I want to see if this can be done:

I have a page with a few images. When the user clicks on an image I want to go to another page and open shadowbox with a specific vimeo video for that image. How do I pass the parameter on to the page with the videos?

Thank you in advance for the answer.