生活随笔
收集整理的這篇文章主要介紹了
jquery模拟LCD 时钟
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
查看效果網(wǎng)址: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時(shí)鐘-柯樂義
</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時(shí)鐘
</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,接著設(shè)置時(shí)間與使用KeleyiLCDClock()方法。
$("#keleyitime").text(Date());
$("#keleyitime").KeleyiLCDClock();
轉(zhuǎn)載自http://keleyi.com/a/bjad/l3u8rpcb.htm
web前端:http://www.cnblogs.com/jihua/p/webfront.html
轉(zhuǎn)載于:https://www.cnblogs.com/jihua/p/lcdclock.html
總結(jié)
以上是生活随笔為你收集整理的jquery模拟LCD 时钟的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。