js-倒计时30秒
来源:互联网 发布:中国频道域名管理 编辑:程序博客网 时间:2024/05/03 06:14
<html>
<head>
<title>倒计时</title>
<!--以下为css样式-->
<style type= "text/css">
.daojishi h2
{
font-family:Helvetica, Microsoft YaHei, Arial, sans-serif;
font-size:14px;
margin-bottom:5px;
color:#151515;
}
.daojishi #timer
{
font-family:Helvetica, Microsoft YaHei, Arial, sans-serif;
font-size:14px;
color:#151515;
font-weight:bold;
}
</style>
</script>
</head>
<body onload = "timer()">
<input type="redio" id="asd" name="asd" onclick="asd()">123
<div class = "daojishi">
<h2>剩余时间为:</h2>
<div id = "timer">
</div>
</div>
</body>
<script type="text/javascript">
var nowts=30000;
var aa=null;
function timer() {
showTime(nowts);
aa=setInterval("nowTimeOver()", 1000);
}
function nowTimeOver() {
console.info(12)
nowts = nowts - 1000;
showTime(nowts);
}
function showTime(ts) {
if(nowts<1000){
window.clearInterval(aa);
}
document.getElementById("timer").innerHTML = checkTime(parseInt(ts / 1000 % 60, 10)) + "秒";
}
function checkTime(i) {
if (i < 10) {
i = "0" + i;
}
return i;
}
</script>
</html>
<head>
<title>倒计时</title>
<!--以下为css样式-->
<style type= "text/css">
.daojishi h2
{
font-family:Helvetica, Microsoft YaHei, Arial, sans-serif;
font-size:14px;
margin-bottom:5px;
color:#151515;
}
.daojishi #timer
{
font-family:Helvetica, Microsoft YaHei, Arial, sans-serif;
font-size:14px;
color:#151515;
font-weight:bold;
}
</style>
</script>
</head>
<body onload = "timer()">
<input type="redio" id="asd" name="asd" onclick="asd()">123
<div class = "daojishi">
<h2>剩余时间为:</h2>
<div id = "timer">
</div>
</div>
</body>
<script type="text/javascript">
var nowts=30000;
var aa=null;
function timer() {
showTime(nowts);
aa=setInterval("nowTimeOver()", 1000);
}
function nowTimeOver() {
console.info(12)
nowts = nowts - 1000;
showTime(nowts);
}
function showTime(ts) {
if(nowts<1000){
window.clearInterval(aa);
}
document.getElementById("timer").innerHTML = checkTime(parseInt(ts / 1000 % 60, 10)) + "秒";
}
function checkTime(i) {
if (i < 10) {
i = "0" + i;
}
return i;
}
</script>
</html>
0 0
- js-倒计时30秒
- JS倒计时(时分秒)
- js秒毫秒倒计时
- js倒计时 (秒)
- js 倒计时 时分秒
- js 60秒倒计时
- js时分秒倒计时
- js倒计时10秒
- js时分秒倒计时
- js效果60秒倒计时
- js 实现60秒倒计时
- 秒杀倒计时JS代码
- js 日期+分钟+秒 倒计时
- 倒计时60秒(js)
- 秒杀倒计时JS代码
- 30秒倒计时
- JS实现自动倒计时30秒后按钮才可用
- JS实现自动倒计时30秒后按钮才可用
- Java 拆箱与装箱
- k8s源码分析-----kubelet协程分析
- Perl语言入门(07 Hash)
- 实用mac下常用快捷键和相关使用技巧
- 微博记录
- js-倒计时30秒
- 51nod 1272【二分+RMQ】
- 满足你各种画图需求的插件——highcharts
- 8月31日快捷键
- Android Studio开发JNI工程
- HBase数据导出到HDFS
- 浅析JDBC操作数据库
- 使用TypeScript开发ReactNative应用的简单示例
- minicom安装和使用