2

I think I know the answer to this, but want to make sure I've not missed something...

I have a webpage that has a small, flash logo animation at the top of the screen. I've kept it minimal and it's just a logo, so no critical navigation or anything silly in there. Because it's the first large element to load however, it's sometimes hangs the page a bit and slows everything else down.

Is there a way to tell it the page to load that flash element last? It's the only flash element and I've already implemented jquery on the page (I don't know if that gives me an option?)

Thanks in advance!

3 Answers 3

1

You might set an event listener for the page's onload event and then have the flash load.

Excuse the pseudo-code. I'm not fluent in jQuery.

document.body.onload = function() { var element = $('#flash_container'); element.src = 'flash.swf'; } 
Sign up to request clarification or add additional context in comments.

3 Comments

The question didn't mention jQuery, but here's the proper way of doing it : $(document).ready(function(){ $('#flash_container').attr('src', 'flash.swf')});
@jd Thanks for the correct code. The question states ...and I've already implemented jquery on the page, though...
hmm... that seems to be making the flash load before everything else, including the html. I don't know what I've done wrong with that. gonna keep trying though.
0

I'm no expert but... You could try wrapping it in a div and placing it last in your html code.

If it sits at the top then position: absolute; top: 0; could be fairly straight forward.

1 Comment

That would work,but it's a messy solution. because I want to try and implement this across more than just the flash object - i would like certain javascript galleries to load first or last in some instances - I'm looking for a more broad way to specify a page load order rather than 'cheat the system' if that makes sense...
0

You should use swfobject and/or jquery to embed the flash (in other words dynamically embed) after the document has completed loading or the DOM is ready (whatever suits your needs).

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.