ITeye博客

Jquery定时器jquery.timers.js

xiaoyuwei · 2011-09-01 15:39 · Jquery · Web前端 · Markdown

<html>                                                                 
 <head>                                                                 
 <script type="text/javascript" src="jquery.js"></script>     
 <script type="text/javascript" src="jquery.timers.js"></script>      
 <script type="text/javascript">                                        
   // we will add our javascript code here     
$(document).ready(function() {

}); 
var count=1
function getname(){
  alert(count);
  count++;
}   
function start(){
$("body").everyTime(1000, "getPushedEventTimer", getname, 0);
}
function end(){
$("body").stopTime("getPushedEventTimer", getname);
}         
 </script>                                                              
 </head>                                                                
 <body>  
<div>
 <input type='button' value='开始' onclick='start()'>
 <input type='button' value='结束' onclick='end()'>
</div>
   <!-- we will add our HTML content here -->                                 
 </body>                                                                
 </html>

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。