Home  >  Article  >  Web Front-end  >  Practical JQuery queue animation demo

Practical JQuery queue animation demo

一个新手
一个新手Original
2017-09-09 10:52:501125browse

Not much to say, just post the code

<!-- css -->ul{
    list-style: none;   
}
li{
    font-size: 25px;
    float: left;
    color:grey;
    position: relative;
    margin: 10px;
    opacity: 0;
    left: -200px;
}<!-- html --><ul>
    <li>欢</li><li>迎</li><li>来</li><li>到</li><li>这</li><li>里</li></ul><!-- js -->$("li").last().animate({
            opacity: &#39;1&#39;,
            left: &#39;200px&#39;
        },400,function fn(){
            $(this).prev().animate({
                opacity: &#39;1&#39;,
                left: &#39;200px&#39;
            },400,fn)
        })
        setTimeout(function(){
            $("li").last().animate({
                opacity: &#39;0&#39;,
                left: &#39;400px&#39;
            },400,function fn(){
                $(this).prev().animate({
                    opacity: &#39;0&#39;,
                    left: &#39;400px&#39;
                },400,fn)
            })
        },2500)

Rendering:
Practical JQuery queue animation demo

The above is the detailed content of Practical JQuery queue animation demo. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn