代码如下:
<style type="text/css"> #tingliu{*rgin: 10px 0px 5px 0px; padding: 3px 0px 3px 0px; line-height: 2; text-align:center; font-size:12px;color:#aaa; background: #eee; width: 100%; transition:all 0.2s ease-in-out 0s; -moz-transition:all 0.2s ease-in-out 0s;-webkit-transition:all 0.2s ease-in-out 0s;} #tingliu:hover{background: #61b3e6;color: #fff;} .tingliu5{position:relative; left:0px; top:5px;} </style> <div id="tingliu"><span class="tingliu2">您阅读这篇文章共花了:</span> <span class="tingliu3" id="stime">0小时00分10秒</span></div> <script language="JavaScript">var ss=0,mm=0,hh=0;function TimeGo(){ss++;if(ss>=60){mm+=1;ss=0}if(mm>=60){hh+=1;mm=0}ss_str=(ss<10?"0"+ss:ss);mm_str=(mm<10?"0"+mm:mm);tMsg=""+hh+"小时"+mm_str+"分"+ss_str+"秒";document.getElementById("stime").innerHTML=tMsg;setTimeout("TimeGo()",1000)}TimeGo();</script> |