views:

86

answers:

3

Hey guys. If you haven't already seen, Google has the ability to add a custom background image (for better or worse) and I was wondering how to achieve the same fade-in-on-load effect using jQuery.

Any ideas?

+1  A: 

jQuery has a method for this purpose, fadeIn. See documentation for explanation.

.fadeIn( [ duration ], [ callback ] )

durationA string or number determining how long the animation will run.

callbackA function to call once the animation is complete.

As an aside, fade is often implemented to use javaScript to continually modify the opacity of an element.

Brian
+1 And here's a link to the JQuery API for the `fadeIn` function, if you need it :)http://api.jquery.com/fadeIn/
Justin
A: 

The real question is how do they resize the image on resizing the browser ... fading it in is easy :) you can also do $("#selectdiv").hide().animate({opacity : 1});

I think fadeIn is just a shortcut to that annyway

Emre