<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>
Jquery定时器jquery.timers.js
最新推荐文章于 2024-09-09 09:32:36 发布
本文介绍了如何使用jQuery和jQuery.timers插件实现定时器功能,包括开始、暂停和停止定时器的方法。
585

被折叠的 条评论
为什么被折叠?



