1.

How Can We Give Fade Effect In J Query?

Answer»
  • In jQuery we have three methods to give the fade effect to elements: fadeIn, fadeOut and fadeTo
  • This methods change the opacity of element with animation.

Syntax:

$(SELECTOR).fadeIn(speed,callback) $(selector).fadeOut(speed,callback) $(selector).fadeTo(speed,opacity,callback)
  • “speed” can be ONE of FOLLOWING values : “SLOW”, “fast”, “normal” or milliseconds
  • “opacity” specify the value that allows the fading to given opacity.
  • “callback” is the FUNCTION which we want to run once the fading effect is complete.

For example

$("clickme").click(function(){
$("mydiv").fadeTo("slow",0.50); });
$("clickme").click(function(){
$("mydiv").fadeOut(3000); });.

Syntax:

For example



Discussion

No Comment Found