<script type="text/javascript" src="js/jquery-1.8.3.min.js"></script>
<script type="text/javascript">
function timeout(obj){
if(obj<10){
}else{
var times = obj * 100; // 60秒
countTime = setInterval(function() {
times = --times < 0 ? 0 : times;
var ms = Math.floor(times / 100).toString();
if(ms.length <= 1) {
ms = "0" + ms;
}
var hm = Math.floor(times % 100).toString();
if(hm.length <= 1) {
hm = "0" + hm;
}
if(times == 0) {
//alert("游戏结束");
clearInterval(countTime);
}
// 获取分钟、毫秒数
$(".a").html(ms);
$(".b").html(hm);
}, 10);
}
}
$(function () {
$('.start').click(function () {
var a = $('.a').html();
timeout(a);
})
$('.end').click(function () {
$('.a').html(10);
$('.b').html('00');
clearInterval(countTime);
})
})
</script>
*
回帖描述:*
链接类型:*
下载链接:*
描述:*
回帖描述:*
链接类型:*
阅读权限:*
下载链接:



聚优部落技术论坛 © 版权所有 鲁ICP备15007479号-6
Copyright(C)web.com, All Rights Reserved.
