1<style>2 div{3 width:100px;4 height:100px;5 }6 . Div1{background:red;display:none;}7 . Div2{background:yellow}8 . Div3{background:blue}9 . Div4{background:purple}Ten . Div5{background:pink} One</style> A<p></p> -<div class= "Div1" ></div> -<div class= "Div2" ></div> the<div class= "Div3" ></div> -<div class= "Div4" ></div> -<div class= "DIV5" ></div> -<script> +$ (". Div1"). Hover (); -$ (". Div2"). Slidedown (); +$ (". Div3"). FadeIn (); A$ (". Div4"). FadeOut (). Delay (1000). FadeIn); at$ (". Div5"). FadeOut (). Delay (1000). FadeIn); - //The delay () method can delay the queue, and after fadeout is executed, the next animation can only be performed after waiting for 1200ms, only in the animation - -$ (". Div2"). Click (function(){ - functionShowit () { -$ (". Div1"). FadeIn (2000); in$ (". Div1"). Slidedown (2000); -$ (". Div1"). Slideup (2000); to$ (". Div1"). FadeOut (2000, showit); + } - functionshowab () { the //var n =$ (". Div1"). Queue ("FX"); * //You can also pass an anonymous function, or you can send a function name in an anonymous $ //Note use. Queue () to add a function that should guarantee the last time $ (this). Dequeue (), which allows other functions in the queue to execute sequentiallyPanax Notoginseng$ (". Div1"). Queue ("FX",function(nextfun) { -Alert ("OK, that's all!"); the$ (". Div1"). Dequeue (); + //Nextfun (); A }) the$ ("P"). Text (n.length) +SetTimeout (showit,1000) - } $ Showit (); $ showab (); - }); -$ (". Div3"). Click (function(){ the$ (". Div2"). Slidedown (+). FadeIn (+). FadeOut (+). Slideup (1000); -$ (". Div2"). Queue (function(){WuyiAlert ("Div2 is over!"); the }) - }) Wu -</script>View Code
Jquery-delay (), queue ()