setTimeout和setInterval使用初探

来源:互联网 发布:网络推广人员岗位职责 编辑:程序博客网 时间:2024/05/02 12:26
一切尽在代码截图中,愿意和大家一起成长!可以喷,毕竟是菜鸟!
<!DOCTYPE html><html lang="en"><head>    <meta charset="UTF-8">    <title>Title</title></head><body><div class="wraper"></div><div class="wraper1">abcd123441223432 </div><button onclick="clearIt=window.clearInterval(clearIt)">    Stop</button><script>    window.onload = function () {        $('.wraper').html('12343242342')        setTimeout(function () {            $('.wraper').hide();            setTimeout(function () {                $('.wraper1')[0].style.backgroundColor = 'red';                console.log(new Date(),"in");            },20000);            console.log(new Date(),"out");        },10000);    }    var clearIt=self.setInterval("setIntervalTest()",1000);    function setIntervalTest () {        console.log('++++');    }</script><script type="text/javascript" src="jquery/jquery-min.js"></script></body></html>


0 0
原创粉丝点击