Joke Collection Website - Public benefit messages - JS countdown implementation code (hours, minutes, seconds)

JS countdown implementation code (hours, minutes, seconds)

JS countdown (hours, minutes, seconds)

defined variable

space

=

1000;

function

ShowCountDown (year, month, day, partition name)

{

defined variable

at present

=

new

date();

defined variable

end date

=

new

Date (year,

Month-1,

Day);

defined variable

left time = end date . gettime()-now . gettime();

defined variable

Left second

=

parse int(left time/ 1000);

//var

day 1 = parse int(left second/(24 * 60 * 60 * 6));

defined variable

day 1 = math . floor(left second/(60 * 60 * 24))。

defined variable

hour = math . floor((left second-day 1 * 24 * 60 * 60)/3600);

defined variable

minute = math . floor((left second-day 1 * 24 * 60 * 60-hour * 3600)/60);

defined variable

Second = math.floor (leftsecond-day1* 24 * 60 * 60 hours *3600 minutes * 60);

defined variable

Replicated copy

=

document . getelementbyid(div name);

cc.innerHTML

=

"Script House prompts that the distance from"+year+"year"+month+"day+"is "+day 1+" day "+hour+"hour+"minute+"second ";

}

window . setinterval(function(){ show count down(20 10,4,20,' div down 1 '); },

Interval);

[Ctrl+A

complete inspection

Note: If external Js needs to be introduced, it needs to be refreshed before it can be realized]