Quote:
Originally Posted by wayfarer07
maybe the above works also, but I've always done:
Code:
$(window).load(function() {
//code will wait for all the images to load before executing
//these load events can exist multiple times, unlike an onload event
});
|
This works ok when I try it with a simple line of text inside the anonymous function eg.
$(window).load(function(){
$('#somediv').html('<p>Testing</p>');
});
Actually what I`m trying to do though is to get Jquery to run a Flash movie AFTER the images have been loaded. When I just hard code the flash movie the animation seems a bit jerky and I was wondering if the image downloads might be conflicting with it.
So just for curiosity I tried:
$(window).load(function(){
$('#flash_header').html('
<object type="application/x-shockwave-flash"
width="960" height="157" data="/flash/someflashmovie.swf">
<param name="movie"
value="/flash/someflashmovie.swf"></param>
<param name="wmode" value="transparent"></param></object>
');
});
It didn't work. The Javascript error console says "unterminated string literal" but I cant see why.
|