View Full Version : OnLoad

06-29-2009, 07:33 PM
Hey everyone,

I currently have a jQuery scrolling plugin to scroll to a certain point on the page to execute onload. Here's the code:

<body onLoad="if($.browser.opera){$('html').animate({scrollTop: $('#div').offset().top}, 2000);} else $('html,body').animate({scrollTop: $('#div').offset().top}, 2000);>

The only problem with this is onload executes after all my content is loaded, and I have a sizeable amount of flash and images that all have to load first in order for the page to start scrolling.

Is there any way to have this code execute first in <script> tags or something?

06-30-2009, 04:35 PM
anyone? *bump*

06-30-2009, 09:08 PM
Solution: http://www.geekdaily.net/2007/07/27/javascript-windowonload-is-bad-mkay/