Basic effects
Method: Explain
. Show () displays the selected element
. Hide () hides the selected element
. Toggle () Toggles the displayed and hidden states on the selected element
Fade effect
Method: Explain
. FadeIn () Light the element in the selection makes it opaque
. FadeOut () fades the selected element to make it transparent
. Dadeto () Modify the transparency of the selected element
. Fadetoggle () Use transparency to hide or show the selected element (toggle its current state, or switch to hidden state if current display state)
Slide effects
Method: Explain
. Slideup () Use slide effects to display selected elements
. Slidedown () Use slide effects to hide selected elements
. Slidetoggle () Use the swipe effect to toggle the selected element (toggle its current state, or switch to hidden state if it is currently displayed)
Custom effects
Method: Explain
Execution of operations in the. Delay () Delay queue
. Stop () If an animation is running, stop it
. Animate () Create custom animations
Here is an example (the following example to introduce jquery JS file to see the effect, the following only provides the introduction of code, the file can be downloaded to the official website: http://jquery.com)
Example one:
Html:
1 <!DOCTYPE HTML>2 <HTML>3 <Head>4 <title>Jquery</title>5 <!--<link rel= "stylesheet" href= "Css/mystyle.css"/> -6 <style>7 Body{8 Background-color:#cccac8;9 }Ten ul{ One List-style-type:None; A } - Li{ - Background-color:#fb7b0a; the Border:1px solid #acacac; - } - </style> - </Head> + <Body> - <DivID= "page"> + <H1ID= "header">List</H1> A <H2>Buy Groceries</H2> at <ul> - <LiID= "One"class= "Hot"><em>Fresh</em>Figs</Li> - <binID= "both"class= "Hot">Pine nuts</Li> - <LiID= "three"class= "Hot">Honey</Li> - <LiID= "Four">Balsamic vinegar</Li> - </ul> in </Div> - <Scriptsrc= "Js/jquery-2.2.3.js"></Script> to <Scriptsrc= "Js/js7.js"></Script> + </Body> - </HTML>
Js7.js:
1$(function() {2 3$ (' H2 '). Hide (). Slidedown ();4 var$li = $ (' li ');5$li. Hide (). each (function(index) {6$( This). Delay (* * index). FadeIn (700);7 });8 9$li. On (' click ',function() {Ten$( This). FadeOut (700); One }); A -});
Example two:
HTML: As above, replace the referenced js7.js with Js8.js.
Js8.js:
$ (function() { $(function() { $ (this). Animate ({ 0.0, ' +=80 ' function() { $ (this). Remove (); } );});
Animation effect method in jquery