jQuery Tutorial


jQuery Example


jQuery References


jQuery fadeIn() and fadeOut() and fadeTo() Effects Methods




Using jQuery we can avoid cross browser problem issues and can directly implement the FadeIn() FadeOut() FadeTo() Effect.

jQuery fadeTo() Effect Methods

jQuery fadeTo method perform of the Selected elements.

Syntax

$(selector).fadeTo( speed,opacity,[callback]);
  • speed: Elements is a represent by three predefined String speed ("slow", "normal", "fast"). otherwise number represent by milliseconds (Ex. 3000).
  • opacity: FadeTo() method allow to add opacity parameter to given fading of parameter.
  • callback: Callback is optional parameter. It is use to represents a function to be executed whenever effect is completed.

jQuery fadeTo() Effect Methods Example:

<script type="text/javascript"> 
$(document).ready(function(){
  $("button").click(function(){
    $("div").fadeTo("slow",0.20);
  });
});
</script>
Online Try This Code Your Self....   »

jQuery fadeIn() and fadeOut() Effect Methods

jQuery Fade method use to fadeOut or fadeIn method perform of the Selected elements.

Syntax

$(selector).fadeOut( speed,[callback]);
$(selector).fadeIn( speed,[callback]);
  • speed: Elements is a represent by three predefined String speed ("slow", "normal", "fast"). otherwise number represent by milliseconds (Ex. 3000).
  • callback: Callback is optional parameter. It is use to represents a function to be executed whenever effect is completed.

jQuery fadeIn() and fadeOut() Effect Methods Example:

<script type="text/javascript"> 
$(document).ready(function(){
  $("#btn1").click(function(){
    $("div").fadeOut(5000);
  });
   $("#btn2").click(function(){
    $("div").fadeIn(5000);
  }); 
});
</script>
Online Try This Code Your Self....   »

Full Reference of jQuery Effects References Learn all jQuery Effects References.