Joke Collection Website - Public benefit messages - Countdown code. JS master, please come in!
Countdown code. JS master, please come in!
& lthtml & gt
& lthead & gt
& lttitle & gt Birthday countdown
& ltb> today is the birthday of August 2nd, 20th14th, and
& lt script? language = " JavaScript " & gt
var? Different hours? =? - 1
var? Different? =? - 1
var? Minutes to seconds? =? - 1
var? Tday 1? =? New? Date ("20 14-08-02")/* * countdown time-pay attention to the format.
var? daysms? =? 24? *? 60? *? 60? *? 1000
var? Hours? =? 60? *? 60? *? 1000
var? Secondms? =? 60? *? 1000
var? Microseconds? =? 1000
Function? Clock ()
{
var? Time? =? New? Date ()
var? An hour? =? time.getHours()
var? Minutes? =? time.getMinutes()
var? Second? =? time.getSeconds()
var? Time value? =? ""+((hours? & gt? 12) hour-12: hour)
Time value? += ((minutes? & lt? 10)":0 "::")+ minutes
Time value? += ((seconds? & lt? 10)":0 "::")+ seconds
Time value? += ((hours? & gt 12? )"? PM ":"? AM”)
var? convertHour? =? Different hours
var? convertMinute? =? discrepancy
var? convertSecond? =? Differential minutes and seconds
var? Diffms? =? Tday 1.getTime()? -? time.getTime()
Different hours? =? Math.floor(Diffms? /? Japanese SMS)
Diffms? -=? Different hours? *? Daytime SMS
Different? =? Math.floor(Diffms? /? Hours)
Diffms? -=? Different? *? hourage
Minutes to seconds? =? Math.floor(Diffms? /? Seconds)
Diffms? -=? Minutes to seconds? *? Seconds ms
var? dSecs? =? Math.floor(Diffms? /? Microseconds)
if(convertHour? ! =? DifferHour)? document . form now . DD . value = differ hour
if(convertMinute? ! =? DifferMinute)? document . form now . hh . value = differ minute
if(convertSecond? ! =? DifferSecond)? document . form now . mm . value = differ second
document . form now . ss . value = dSecs
document . form now . ss . value = dSecs
//? document.formnow.Tnow.value=? Different hours? Different? +? Minutes to seconds? +? dSecs
setTimeout("clock()", 1000)
}
& lt/script & gt;
& lt/head & gt;
& lt body? onload = " clock(); Return? Really? text = " red " & gt
& lt form? name = " formnow " & gt
& lt input? name="dd "? type="text "? style = " border:0;" ? size = 2 & gt
sky
& lt input? name="hh "? type="text "? style = " border:0;" ? size = 2 & gt
hour
& lt input? name="mm "? type="text "? style = " border:0;" ? size = 2 & gt
minute
& lt input? name="ss "? type="text "? style = " border:0;" ? size = 2 & gt
second
& lt/form & gt;
& lt/body & gt;
& lt/html & gt;
- Related articles
- I gave the lion man the cold shoulder for a long time. Wechat message didn't return, so I called to answer it. What happened?
- Netease cloud account changes the bound mobile phone number.
- I will buy things online. The delivery address has been filled in at the rookie station. How can I get it?
- How to cancel the short message service of rural credit cooperative card
- 12 1 10 should I add the area code after the alarm information?
- Identification standard of violent collection
- What is the telephone number of 58 manual customer service in the same city?
- Please give my son a name!
- How to check the bank number of Bank of China?
- How to send a short message to an overdue mobile phone card?