码迷,mamicode.com
首页 > Web开发 > 详细

HTML倒计时简单实现

时间:2014-11-13 23:57:30      阅读:407      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   io   color   ar   os   sp   java   

bubuko.com,布布扣
 1 <!doctype html>
 2 <html lang="en">
 3 <head>
 4     <meta charset="UTF-8">
 5     <title>Document</title>
 6     <style type="text/css">
 7         h1{
 8             font-size: 50px;
 9             text-align: center;
10         }
11     </style>
12 </head>
13 <body>
14 <h1>倒计时:<span>10</span></h1>
15 <script type="text/javascript" src = "http://libs.baidu.com/jquery/1.10.0/jquery.min.js"></script>
16 <script type="text/javascript">
17     $(document).ready(function(){
18         var e = $("h1 span").first();
19         var i = 9;
20         var interval = setInterval(function(){
21             e.html(i);
22             i--;
23             if(i <= 0){
24                 clearInterval(interval);
25             }
26         },1000);
27     })
28 </script>
29 </body>
30 </html>
View Code

 

HTML倒计时简单实现

标签:style   blog   http   io   color   ar   os   sp   java   

原文地址:http://www.cnblogs.com/sxmcACM/p/4096071.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!