1. Method:
- Hide (speed, [callback]);
- Show (speed, [callback]);
Note: These two methods can also be used to hide and show animations. Speed can be "slow" (600 ms), "normal" (400 ms), "fast" (200 ms), or a number of milliseconds.
Callback is the callback function after the animation is executed.
2. instance:
> ---: -- Height: </style> <div => <span> & nbsp; </span> <span> jQuery </span> <span style => -- write less, more. </span> & nbsp; <a href => display </a> </div>Html
<Script type = "text/javascript"> $ link = $ (". artList a "$ hide = $ (". artList: eq (2) "($().html () =" show ").html (" hide "1000, () {alert (" show ").html (" show "800 ,() {alert ("hide" </script>
1. Method
- Toggle (): No parameter. You can directly switch to the hidden state;
- Toggle (switch): The switch is a Boolean value. true indicates the display element, and false indicates the hidden element.
- Toggle (speed, [callback]): speed indicates the switching speed, and callback indicates the callback function after the animation effect is executed.
Note: When an animation is displayed, the width, height, padding, and margin of the element are displayed in the animation format.
2. instance:
==>< Div => <input id = type = value =/> <br/> <input id = type = value =/> </div> <div => </div>Html
<Script type = "text/javascript"> isShow = title = $ (". divTitle "content = $ (". divContent "" img "). slideUp ("normal", "# divTip" ).html ("disabled successfully" = "img "). slideDown ("normal" "# divTip" pai.html ("" = </script>
- SlideUp (speed, [callback]): slides up to reduce the element height to 0
- SlideDow (speed, [callback]): slides down to increase the element height.
- SlideToggle (speed, [callback]): switches the element height with an animation effect.
1. Fade-in and fade-out methods
- FadeIn (speed, [callback]): fade in, transparency from 0.0 to 1.0;
- FadeOut (speed, [callback]): fade out, transparency from 1.0 to 0.0;
Instance:
==>< Div => <input id = type = value =/> </div> <div => </div> </div>Html
<Script type = "text/javascript" >=$ ("img"); $ tip = $ (". divTip "); $ (" # Button1 "). click () {effectip.html (""); $ img. fadeIn (2000, "Fade in successful! "" # Button2 "). click () {effectip.html (" "); $ img. fadeOut (2000," Fade out successful! "</Script>
2. fadeTo(Speed, opacity, [callback]): sets the transparency as a specified value based on the animation effect. You can also set a callback function.
Instance:
Html
<script type="text/javascript"> opacity = 0.0"#btn").click( (opacity >= 1.0= 0.0+= opacity + 0.2"img").fadeTo("normal"</script>
1. Method:
Animate (params, [duration], [easing], [callback])
Note: param indicates the attribute key-value pair to be adjusted, duration indicates the speed, easing indicates the animation plug-in, and callback indicates the callback effect after the animation effect is completed.
Note:
Params attribute names must be written in the form of camels. For example, font-size must be written as fontSize.
If you want to move the element position as an animation, the position must be set to relative or absolute.
Queue Animation: execute one or more animation methods in the element.