tags:

views:

47

answers:

2

Show image very slowly ... after page is completely loaded....

That is ,

fade in Effect for the image, but this image should show very slowly page load is completed....

+4  A: 

Assuming you meant onload (all assets have downloaded) and not DOMReady (the page itself is ready to go):

$(window).load(function () {
    $('img').fadeIn(10000); // 10 seconds
});

Code untested. Don't forget to set images to have an opacity of 0 in your CSS when you start.

Matchu
> $(window).load(function () {> $('#book').animate({ height: 'show', opacity: 'show' }, 'slow'); > > });i tried somthing like this
Bharanikumar
A: 

alternative approach to @Matchu's, still need the css opacity set to 0

$(document).ready(function () {
    $('img').show(10000); // 10 seconds
});

EDIT: this will also animate the hight and width, in addition to the opacity.

derek
I don't think `show` and `fadeIn` have the same effect - it depends on which he really wants.
Matchu
$(window).load(function () {$('#book').animate({ opacity: 5.25, left: '+=50', height: 'toggle' }, 5000, function() { // Animation complete. });});with this snippet...but image need to show
Bharanikumar
@Matchu: from jquery docs: When a duration is provided, .show() becomes an animation method. The .show() method animates the width, height, and opacity of the matched elements simultaneously.
derek
@derek - Right. `show` animates height and width, as well. `fadeIn` just fades it in.
Matchu