• _#【jQuery】


    animate + +=

    <!doctype html>
    <html lang="zh-CN">
    <head>
        <meta charset="utf-8" />
        <title></title>
        <style type="text/css">
            *{margin:0;padding:0}
            div{position:absolute;top:100px;left:0;width:100px;height:100px;background:#f00}
        </style>
    </head>
    <body>
        <div></div>
        <a href="javascript:void(0)">+</a>
        <a href="javascript:void(0)">+=</a>
        <script src="http://upcdn.b0.upaiyun.com/libs/jquery/jquery-2.0.0.min.js"></script>
        <script>
            $(function(){    
                $('a:eq(0)').click(function(){
                    if(!$('div').is(':animated')){
                        $('div').animate({left : '+100px'}, 1000);
                    }        
                });
                $('a:eq(1)').click(function(){
                    if(!$('div').is(':animated')){
                        $('div').animate({left : '+=100px'}, 1000);
                    }
                });
            })
        </script>
    </body>
    </html>

    trigger

  • 相关阅读:
    html常用标签_new
    Nginx缓存
    购物车
    css的属性选择
    前端基础之css
    htm基础知识
    TypeScript(1)为什么需要TypeScript
    Electron
    Ant Design
    Umi
  • 原文地址:https://www.cnblogs.com/jzm17173/p/2493917.html
Copyright © 2020-2023  润新知