<body>
<div id= ' res ' ><span id= ' d ' ></span><span id= "h" ></span><span id= "M" ></span ><span id= "S" ></span></div>
</body>
<script src= "./jquery-1.4.2.js" type= "Text/javascript" ></script>
<script type= "Text/javascript" charset= "Utf-8" >
var now = new Date (); Current time
2012-07-26 16:22:53
var endtime = new Date (Now.gettime () +1000*60*60*24*2); Current time + 2 days Note that gettime () in JS is computed in milliseconds so *1000 PHP is calculated in seconds
function timer () {
now = new Date ();
var t = endtime.gettime ()-now.gettime ();
if (T > 0) {
var s = Math.floor (t/1000)%60; Seconds
var m = Math.floor (t/(1000*60))%60; Part
var h = Math.floor (t/(1000*60*60))%24; When
var d = Math.floor (t/(1000*60*60*24)); Days
s = (s<10)? ' 0 ' +s:s;
document.getElementById ("D"). innerhtml=d+ "Tian";
document.getElementById ("H"). innerhtml=h+ "Hour";
document.getElementById ("M"). innerhtml=m+ "cent";
document.getElementById ("S"). innerhtml=s+ "seconds";
}else{//To time after border shadow glow
if (t% 2 = 0) {
$ (' #res '). CSS ({"Box-shadow": "0 0 12px Rgba (170, 0.5)", "-o-box-shadow": "0 0 22px Rgba (72, 170, 0.5) ","-moz-box-shadow ":" 0 0 12px Rgba (0, 170, 0.5) ","-webkit-box-shadow ":" 0 12px Rgba (72, 106, 170, 0.5) "," Border-color ":" Rgba (160, 179, 214, 0.5) "});
}else{
$ (' #res '). CSS ({"Box-shadow": "0 0 12px Rgba (), 0 0 18px 1.0 (0, RGBA, 140, 255)", "1.0 Adow ":" 0 0 12px Rgba (170, 1.0), 0 0 18px rgba (0, 140, 255, 1.0) ","-moz-box-shadow ":" 0 0 22px Rgba (72, 106, 170, 1 .0), 0 0 18px rgba (0, 140, 255, 1.0) ","-webkit-box-shadow ":" 0 0 12px Rgba (+,, 170, 1.0), 0 0 18px rgba (0, 140, 255, 1 .0) "," Border-color ":" Rgba (160, 179, 214, 1.0) "});
}
}
}
SetInterval ("Timer ()", 1000);
</script>