example jquery fadeIn () demonstrates the jquery FadeIn () method. jquery FadeOut () demonstrates the jquery FadeOut () method. jquery Fadetoggle () demonstrates the jquery Fadetoggle () method. jquery FadeTo () demonstrates the jquery FadeTo () method. jquery fading method with jquery, you can implement the fade-out effect of the element. jquery has the following four methods of Fade: FadeIn () FadeOut () Fadetoggle () fadeTo () jquery fadeIn () method jquery FadeIn () is used to fade in the hidden element. Syntax: $ (selector). FadeIn (speed,callback); The optional speed parameter specifies the length of the effect. It can take the following values:"Slow", "fast"or milliseconds. The optional callback parameter is the name of the function that is executed after fading completes. The following example shows the FadeIn () method with different parameters: instance $ ("button"). Click (function(){ $("#div1"). FadeIn (); $("#div2"). FadeIn ("slow")); $("#div3"). FadeIn (3000);}); The jquery FadeOut () method jquery FadeOut () method is used to fade out visible elements. Syntax: $ (selector). FadeOut (speed,callback); The optional speed parameter specifies the length of the effect. It can take the following values:"Slow", "fast"or milliseconds. The optional callback parameter is the name of the function that is executed after fading completes. The following example shows the FadeOut () method with different parameters: instance $ ("button"). Click (function(){ $("#div1"). FadeOut (); $("#div2"). FadeOut ("slow")); $("#div3"). FadeOut (3000);}); jquery Fadetoggle () method the jquery Fadetoggle () method can be toggled between the fadeIn () and the FadeOut () method. If the element has faded out, fadetoggle () adds a fade effect to the element. If the element has been faded in, fadetoggle () adds a fade effect to the element. Syntax: $ (selector). Fadetoggle (speed,callback); The optional speed parameter specifies the length of the effect. It can take the following values:"Slow", "fast"or milliseconds. The optional callback parameter is the name of the function that is executed after fading completes. The following example shows the Fadetoggle () method with different parameters: instance $ ("button"). Click (function(){ $("#div1"). Fadetoggle (); $("#div2"). Fadetoggle ("slow")); $("#div3"). Fadetoggle (3000);}); jquery FadeTo () method the jquery FadeTo () method allows the gradient to be a given opacity (values between0 and 1between). Syntax: $ (selector). FadeTo (speed,opacity,callback); the required speed parameter specifies the length of the effect. It can take the following values:"Slow", "fast"or milliseconds. The required opacity parameter in the FadeTo () method sets the fade effect to the given opacity (values between0 and 1between). The optional callback parameter is the function name that is executed after the function completes. The following example shows the FadeTo () method with different parameters: instance $ ("button"). Click (function(){ $("#div1"). FadeTo ("Slow", 0.15); $("#div2"). FadeTo ("Slow", 0.4); $("#div3"). FadeTo ("Slow", 0.7);});
JQuery effect-Fade in