- 積分
- 5068
- 威望
- 5068
- 金錢
- 2878
- 最後登錄
- 2024-11-26
|
本帖最後由 无界 於 2013-10-20 18:44 編輯
- <script src="http://rainmeter.look.in/js/cj.js" type="text/javascript"></script>
- <script>
- function lxfEndtime(){
- $(".lxftime").each(function(){
- var lxfday=$(this).attr("lxfday");
- var endtime = new Date($(this).attr("endtime")).getTime();
- var nowtime = new Date().getTime();
- var youtime = endtime-nowtime;
- var seconds = youtime/1000;
- var minutes = Math.floor(seconds/60);
- var hours = Math.floor(minutes/60);
- var days = Math.floor(hours/24);
- var CDay= days ;
- var CHour= hours % 24;
- var CMinute= minutes % 60;
- var CSecond= Math.floor(seconds%60);
- if(endtime<=nowtime){
- $(this).html("新春快乐!")
- }else{
- if($(this).attr("lxfday")=="no"){
- $(this).html("<i>剩余时间:</i><span>"+CHour+"</span>时<span>"+CMinute+"</span>分<span>"+CSecond+"</span>秒");
- }else{
- $(this).html("<i>剩余时间:</i><span>"+days+"</span><em>天</em><span>"+CHour+"</span><em>时</em><span>"+CMinute+"</span><em>分</em><span>"+CSecond+"</span><em>秒</em>");
- }
- }
- });
- setTimeout("lxfEndtime()",1000);
- };
- $(function(){
- lxfEndtime();
- });
- </script>
- <style type="text/css">
- <!--
- *{
- font-style: normal;
- font-weight: normal;}
- .haveday {
- padding: 20px;
- border: 1px dashed #000;
- margin-right: auto;
- margin-left: auto;
- width: 300px;
- }
- -->
- </style>
- <body>
- <div class="haveday">
- <h1>距2014年春节还有</h1>
- <div class="lxftime" endtime="1/31/2014 00:00:00"></div>
- </div>
- </body>
複製代碼 |
-
1
評分人數
-
|