Code:
< script type= "text/javascript" >
$(document).ready(function() {
givetime();
})
var endtimes = new Array(); //
var myDate;
var time_end;
function givetime() {
var int_day, int_hour, int_minute, int_second;
endtimes[0] = $("-sharpactivity_time1").val();
endtimes[1] = $("-sharpactivity_time2").val();
myDate = new Date().getTime(); //
window.setTimeout("DownCount()", 1000);
}
function DownCount() {
for(var i = 0; i < 2; iPP) {
var time_distance;
time_end = new Date(endtimes[i]).getTime();
time_end = time_endPP;
time_distance = time_end - myDate; //
if(time_distance <= 0) {
$("-sharpGroup_time"+i).html(":");
} else {
timechange(time_distance, i);
}
}
window.setTimeout("DownCount()", 1000);
}
function timechange(time_distance, i) {
int_day = Math.floor(time_distance / 86400000) //
time_distance -= int_day * 86400000; //
int_hour = Math.floor(time_distance / 3600000) //
time_distance -= int_hour * 3600000; //
int_minute = Math.floor(time_distance / 60000) //
time_distance -= int_minute * 60000; //
int_second = Math.floor(time_distance / 1000) //
//
if(int_hour < 10){
int_hour = "0" + int_hour;
}
if(int_minute < 10){
int_minute = "0" + int_minute;
}
if(int_second < 10){
int_second = "0" + int_second;
}
$("-sharpGroup_time" + i).html("<em></em>" + int_day + "" + int_hour + "" +int_minute + "" + int_second + "");
}
</script>
time is always static, and the implementation effect is dynamic. The problem now is not to move