AJAX
Basics
Data
DOM
Effects
Events
Forms
jQuery UI
Plug Ins
Traversing
Common fading methods:
http://www.w3schools.com/jquery/jquery_fade.asp
Goodbye cruel world.
The jQuery fadeToggle() method toggles between the fadeIn() and fadeOut() methods. If the elements are faded out, fadeToggle() will fade them in. If the elements are faded in, fadeToggle() will fade them out.
The required speed parameter specifies the duration of the effect. It can take the following values: "slow", "fast", or milliseconds.
The required opacity parameter in the fadeTo()
method specifies fading to a given opacity (value between 0 and 1).
The optional callback parameter is a function to be executed after the function completes.
$(document).ready(function ()
{
$("#btnFadeIn").click(function ()
{
$("#div1").fadeIn();
$("#div2").fadeIn("slow");
$("#div3").fadeIn(5000);
});
$("#btnFadeOut").click(function ()
{ $("#demo2").fadeOut(2000); });
$("#btnFadeToggle").click(function ()
{ $("#demo3").fadeToggle(3000); });
$("#btnFadeTo").click(function ()
{ $("#demo4").fadeTo(4000, 0.25, function(){ alert("all done"); }); });
});