Onload/Callback Issue in IE7 for dynamic pages

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

Onload/Callback Issue in IE7 for dynamic pages

dustyflyer
I have created two dynamic pages that use jQuery to import Flickr Images and YouTube. I have added rel="shadowbox" to each of the thumbnail links but it doesn't activate Shadowbox after the page loads. If I open it in Firefox it performs as it should but IE7 doesn't work at all. I know Shadowbox is working for static images and static YouTube videos in IE7 but not for the thumbnails that are loaded. I suspect it's something with the windows onload functions. Here is the onload script I used:

<script type="text/javascript"> window.onload = function(){ Shadowbox.init(); }; </script>
I am wondering if I need some sort of jQuery callback function or DOM event. I could use any help you experts can offer Thanks ~~ dustyflyer

Flickr Page http://www.skydivekapowsin.com/new/flickr.php

YouTube http://www.skydivekapowsin.com/new/youtube.php
Reply | Threaded
Open this post in threaded view
|

Re: Onload/Callback Issue in IE7 for dynamic pages

Wizzud
For jQuery as the library, try using...

<script type='text/javascript'> jQuery(document).ready(function(){ Shadowbox.init(); }); </script>
Combine literacy with curiosity and a whole world of information opens up to you
Reply | Threaded
Open this post in threaded view
|

Re: Onload/Callback Issue in IE7 for dynamic pages

dustyflyer
I have done that but I still have the issue. Also it doesn't work in Firefox when I use the jQuery onload code. Any ideas? Thanks for the help
Reply | Threaded
Open this post in threaded view
|

Re: Onload/Callback Issue in IE7 for dynamic pages

dustyflyer
In reply to this post by Wizzud
What about a callback event after my photos have loaded so IE will fire shadowbox? I'm not sure how to implement that?
Reply | Threaded
Open this post in threaded view
|

Re: Onload/Callback Issue in IE7 for dynamic pages

Wizzud
I am not familiar with the flickr plugin for jQuery, but your problem is that you are initialising shadowbox before all your images are loaded into the page, so it doesn't find anything relevant to attach a click event to.

If there is an 'oncomplete' type of callback available from the flickr plugin, then use that to run Shadowbox.setup() on a per-element basis as each photo gets loaded into the page (use skipSetup:true in the Shadowbox.init call).
Alternatively, if the flickr plugin has an 'oncomplete' type of callback that runs once all the photos have loaded, then just use that to re-run Shadowbox.setup().
[looking at the Settings documentation for the flickr plugin, it might be the 'callback' setting that you need to use - but the documentation is a little bit unclear on exactly when that fires, so I'm not entirely sure]

Basically, there's nothing Shadowbox itself can do if it can't find any relevant links on the page at the time that it runs its auto-setup. It then becomes your responsibility to tell it exactly which links it should add to its cache and watch for clicks on.
Combine literacy with curiosity and a whole world of information opens up to you