• jquery自定义动画


    <!DOCTYPE html>
    <html>
        <head>
            <meta charset="utf-8">
            <title></title>
            <style type="text/css">
                #box{
                    width: 200px;
                    height: 200px;
                    background-color: pink;
                }
            </style>
        </head>
        <body>
            <button id="kaishi">开始</button>
            <button id="jieshu">结束</button>
            <div id="box"></div>
        </body>
        <script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.js"></script>
        <script>
            $(function(){
                // $('button').click(function(){
                //     $('#box').animate({"marginLeft":1000},2000,function(){
                //         $(this).animate({'marginTop':200},500)
                //     })
                // })
                $('#kaishi').click(function(){
                    $('#box').animate({"marginLeft":1000},2000)
                    $('#box').animate({'marginTop':200},500)
                    $('#box').delay(3000).animate({'marginLeft':0},1000)    //delay(3000)延迟,隔多少秒后执行
                })
                $('#jieshu').click(function(){
                    // $('#box').stop(true)    //清空动画队列
                    // $('#box').stop()    //结束,默认为false
                    // $('#box').stop(true,true)    //完成当前动画,把后面动画清空
                    $('#box').stop(false,true)    //当前动画到最后一个状态,继续执行下面所有动画
                })
            })
        </script>
    </html>
  • 相关阅读:
    extjs2.0
    抽象类和接口的选择
    获得汉字字符串的首字母
    快速找回桌面快捷方式
    vs2008破解90天限制
    SQL Server索引的使用和优化
    SQL Server 索引结构及其使用
    桥接模式(Bridge)体验
    vs2008 Working with jQuery
    利用索引来提高速度
  • 原文地址:https://www.cnblogs.com/yueranran/p/12889564.html
Copyright © 2020-2023  润新知