查看效果网址:http://keleyi.com/keleyi/phtml/jqtexiao/24.htm


以下是HTML文件源代码:

 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 2 <html xmlns="http://www.w3.org/1999/xhtml">
 3 <head>
 4 <title>jQuery模拟LCD时钟-柯乐义</title>
 5 <script type="text/javascript" src="http://keleyi.com/keleyi/pmedia/jquery/jquery-1.11.0.min.js"></script>
 6 <link rel="Stylesheet" type="text/css" href="http://keleyi.com/keleyi/phtml/jqtexiao/24/jquery.KeleyiLCDClock.css" />
 7 <style type="text/css">
 8 div{margin-bottom:10px}
 9 </style>
10 </head>
11 <body>
12 <div><h2>jQuery模拟LCD时钟</h2><a href="http://keleyi.com/a/bjad/l3u8rpcb.htm" target="_blank">原文</a>
13 </div>
14 <div id="keleyitime1">2014/4/24 12:38:20</div>
15 <div id="keleyitime2">2000/1/1 23:59:46</div>
16 <div id="keleyitime3">1680/12/31 23:59:47</div>
17 <div id="keleyitime4">2011/3/26 20:18:12</div>
18 <script type="text/javascript" src="http://keleyi.com/keleyi/phtml/jqtexiao/24/jquery.KeleyiLCDClock.js"></script>
19 <script type="text/javascript">
20 $(document).ready(function(){
21 $("#ke"+"leyitime4").text(Date());
22 $("#kele"+"yitime1").KeleyiLCDClock();
23 $("#keley"+"itime2").KeleyiLCDClock();
24 $("#kel"+"eyitime3").KeleyiLCDClock();
25 $("#k"+"eleyitime4").KeleyiLCDClock();
26 });
27 </script>
28 </body>
29 </html>

 

使用:

引用jquery.KeleyiLCDClock.css文件和jquery.KeleyiLCDClock.js文件。
然后定义div的id,比如keleyitime,接着设置时间与使用KeleyiLCDClock()方法。
$("#keleyitime").text(Date());
$("#keleyitime").KeleyiLCDClock();

转载自http://keleyi.com/a/bjad/l3u8rpcb.htm

web前端:http://www.cnblogs.com/jihua/p/webfront.html

posted on 2014-04-25 12:25  计划  阅读(2558)  评论(0编辑  收藏  举报