美文网首页
jquery 延时执行

jquery 延时执行

作者: Otherthing | 来源:发表于2018-06-28 10:35 被阅读0次

    //以下两种方式都行:

    setTimeout(function () { test(); }, 2000);

    //或者

    setTimeout('test()',2000);

    function test(){

    alert("aaaa");

    }

    //以下是错误示例

    setTimeout(test(),2000);

    //会马上执行,没有延迟效果

    相关文章

      网友评论

          本文标题:jquery 延时执行

          本文链接:https://www.haomeiwen.com/subject/hhfgyftx.html