Jquery-delay (), queue ()

Source: Internet
Author: User

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 ()

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.