日期:2014-05-18 浏览次数:20415 次
正计时代码特效.
以下是HTML网页特效代码,点击运行按钮可查看效果: 以下是程序代码<!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></font> <a href="http://js.aiyiweb.com/">欢迎访问爱易网网页特效代码站,js.aiyiweb.com</a> [Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]