• Javascript传参参考


    可参考的细节:

    <!doctype html>
    <html lang="en">
     <head>
      <meta charset="UTF-8">
      <meta name="Generator" content="EditPlus®">
      <meta name="Author" content="">
      <meta name="Keywords" content="">
      <meta name="Description" content="">
      <title>定时器-移动</title>
      <script type="text/javascript" src="jquery-3.2.1.min.js"></script>
     </head>
    
    <style>
     #div{100px;height:100px;background:red;position:absolute; top:100px;}
     
    </style>
     <body>
      <div id="div"></div>
      <div id="div2"></div>
    <script>
    var a=0;
    function move(obj,time){
        var t=setInterval(function(){
           a=a+1;
            if(a<=200 && a>=0){
                obj.css("left",a);
            }
            else{
                clearInterval(t);
            }
        },time)
    }
    move($("#div"),10);
    move($("#div2"),500);
    
    </script>
    
    
     </body>
    </html>
    
    move($("#div"),10);注意传参
  • 相关阅读:
    min_25筛入门
    [湖南集训]更为厉害/谈笑风生
    [ARC060D] 最良表現
    [CQOI2007]矩形
    [SCOI2009]粉刷匠
    PAT乙级1030
    PAT乙级1028
    PAT乙级1029
    PAT乙级1026
    PAT乙级1027
  • 原文地址:https://www.cnblogs.com/xh_Blog/p/8854797.html
Copyright © 2020-2023  润新知