15

Nov 2010

Load Function of Jquery

I have encountered a bug on ie8, a css navigation to fadein once the flash was loaded. I have used the geturl function, the css navigation second level wasnt properly working.

Then, I google the on load function and other possibilities to load the navigation. Jquery have already load function that very useful. The load method is the simplest way to fetch data from the server.

Example 1: Load once the flash element was loaded or the whole html loaded.

$(document).ready(function(){
$(window).load( function () {
$('#myLoad').fadeTo(0, 1);
})
.end();
});

Example 2: As preloader

$(document).ready(function(){
$(window).load( function () {
$("#preloader").fadeOut(2000); THE PRELOADER
$("#image_container").fadeIn(3000); THE IMAGES
});
})
.end();
});