老子是80后的强人,却保持着70后的优秀思想,拥有90后的聪明头脑,贱踏在00后艰苦奋斗的大马路上……
偷个正计时代码
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="cn" lang="cn"> <head> <title></title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"/> <style type="text/css"> #thenceThen{font-size:2em;} </style> <script type="text/javascript" language="javascript"> function thenceThen(timespan){ var date1=new Date(timespan); var totalSecs=(new Date()-date1)/1000; var days=Math.floor(totalSecs/3600/24); var hours=Math.floor((totalSecs-days*24*3600)/3600); var mins=Math.floor((totalSecs-days*24*3600-hours*3600)/60); var secs=Math.floor((totalSecs-days*24*3600-hours*3600-mins*60)); document.getElementById("thenceThen").innerText=timespan+"距今:"+days+"天"+hours+"小时"+mins+"分钟"+secs+"秒"; } var clock; window.onload=function(){ clock=self.setInterval("thenceThen('2005/01/01')", 500); } </script> </head> <body> <div id="thenceThen"></div> </body> </html>
提示:您可以先修改部分代码再运行
姓名
Email (不会被公布)
网站
Spam protection: Sum of 3 + 6 ?
本文分类于uncat.您可以订阅本文评论的RSS 2.0.您可以 发表评论, 或者引用本文 到您的站点
0 Responses to “偷个正计时代码”