码迷,mamicode.com
首页 > Web开发 > 详细

JQuery Advanced

时间:2018-01-07 20:23:21      阅读:159      评论:0      收藏:0      [点我收藏+]

标签:min   title   技术   cti   alt   java   tle   lap   htm   

1.Jquery Utility

<1> Type & Function & setTimeOut

技术分享图片
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../../jquery/jquery-3.2.1.min.js"></script>
</head>
<body>

<h1>Type test Functions demo</h1>
<div id="output"></div>

<script type="text/javascript">
    function addText() {
        $(#output).append(HelloWorld<br>);
    }

    function callAnotherFunction(times, delay, func) {
        var otimes = $.isNumeric(times)? times:3;
        var odelay = $.isNumeric(delay)? delay:300;
        if(!$.isFunction(func)){
            return false;
        }

        var i = 0;
        (function loopIt() {
            i++;
            func();
            if(i<times){
                setTimeout(loopIt,delay);
            }
        })();
    }

    $(document).ready(function () {
        callAnotherFunction(3,300,addText);
    })
    
</script>
</body>
</html>
View Code

 

JQuery Advanced

标签:min   title   技术   cti   alt   java   tle   lap   htm   

原文地址:https://www.cnblogs.com/gearslogy/p/8228427.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!