jQuery animation and special effects

A display and hide animation

1. Display hide () and hide show ()

grammar:

1 jQuery objects the .Show (duration, [Fn]); 
2 the jQuery objects .hide (duration, [Fn]); 
. 3 / * where animation is running time duration, optional fill slow, normal, fast, at a speed corresponding respectively as 600ms, 400ms, 200ms. 
4 may be directly filled a few milliseconds, fn is a function of the callback function, this function is called after the operation is completed * /

2.toggle () function

grammar:

jQuery object .toggle ();
 / * no reference format, switching between displaying and hiding * / 
jQuery object .toggle (to true or to false); 
/ * with a Boolean, display element is true, otherwise, the hidden element * / 
the jQuery objects .toggle (DURATION, [Fn]); 
/ * and show () function used similarly * /

 

Second, the fade in and fade out animation

1. Fade fadeIn () fade fadeOut ()

grammar:

jQuery object .fadeIn (duration, [Fn]); 
jQuery object .fadeOut (duration, [Fn]); 
/ * is essentially change the transparency of elements * / 
/ * where the time duration is run animation, optional fill SLOW, normal, fast, corresponding to speeds of 600ms, 400ms, 200ms. 
Can directly fill in a few milliseconds, fn function as a callback function, calling this action is completed the function * /

2.fadeToggle function

grammar:

jQuery object .fadeToggle (DURATION, [Fn]);   / * in switching between displaying and hiding * /

 

3.fadeTo function

grammar:

jQuery object .fadeTo (DURATION, Opacity, [Fn]); / * Opacity of transparency, from 0 to 1, 1 is a transparent * /

 

Third, it is sliding in and out animation

1. slide slideDown () and out at slideUp ()

grammar:

jQuery object .slideDown (duration, [Fn]); 
jQuery object .slideUp (duration, [Fn]); 
/ * essentially changing the height of the element * / 
/ * where the time duration is run animation, optional fill SLOW, normal, fast, corresponding to speeds of 600ms, 400ms, 200ms. 
Can directly fill in a few milliseconds, fn function as a callback function, calling this action is completed the function * /

 

2.slideToggle function

grammar:

jQuery object .slideTo (DURATION, [Fn]);   / * dynamically changing the height of the element * * /

 

Third, custom animation and stop

1. simple animation

grammar:

jQuery object .animate (params, [duration], [that the easing], [the Fn])
 / * params represents the properties of the style used to animate and worthy collection of 
duration represents three default speed of the character, slow, normal, fast or self defined number of milliseconds 
easing animation plug-ins for expressing the animation effect control, and usually have linear character values swing 
fn animation completes, execution of the callback function * /

 

2. Stop Animation

grammar:

jQuery object .stop ([clerQueue], [gotoEnd]);
 / * two parameters are Boolean type 
clerQueue indicates whether or not to perform clear the animated parade 
gotoEnd indicates whether the completed animation being executed immediately

 

Guess you like

Origin www.cnblogs.com/knny/p/11763612.html