Código de cuenta regresiva. ¡Maestros de JS, por favor entren!
& lthtml & gt
& lthead & gt
& lttitle & gtCuenta regresiva de cumpleaños
& ltb & gtHoy es cumpleaños de 2014 en agosto 2º, y
& ltscript? idioma = " JavaScript " & gt
var? ¿Diferentes horarios? =?-1
var? ¿diferente? =?-1
var? ¿Segundos diferenciales? =?-1
var? ¿Tdía1? =?¿Nuevo? Fecha("2014-08-02")/* *Tiempo de cuenta atrás: tenga en cuenta el formato.
var? díasms? =?24?*?60?*?60?*?1000
var? ¿Hora? =?60?*?60?*?1000
var? ¿Segundos? =?60?*?1000
var? ¿Microsegundos? =?1000
¿Función? reloj()
{
var? ¿tiempo? =?¿Nuevo? fecha()
var? ¿Una hora? =?time.getHours()
var? ¿minuto? =?time.getMinutes()
var? ¿segundo? =?time.getSeconds()
var? ¿Valor del tiempo? =?" "+((hora?& gt?12)hora-12:hora)
¿Valor de tiempo? +=((minutos?<?10)":0 "::")+minutos
¿Valor de tiempo?+=((segundos?<?10)":0 "::") +segundos
¿Valor del tiempo? +=((hora?& gt12?)"?PM ":"?AM")
var? convertirHora? =?diferentes horas
var? convertirMinuto? =?diferencia
var? convertirSegundo? =?Segundos diferenciales
var? ¿Diferencias? =?Tday1.getTime()? -?time.getTime()
¿Horarios diferentes? =?Math.floor(¿Diffms?/?日Mensaje)
¿Diffms? -=?Diferentes horas? *?SMS diurnos
¿Diferentes? =?Math.floor(¿Difmas?/?hora)
¿Difmas? -=?Diferente? *?Horas
¿Segundos diferenciales? =?Math.floor(Diffms?/?Segundos)
¿Diffms? -=?Segundos diferenciales? *?Seg ms
var? dSegundos? =?Math.floor(Diffms?/?microsegundos)
if(convertHour?!=?DifferHour)? documento. formulario ahora. valor DD = hora diferente
if(convertMinute?!=?DifferMinute)? documento. formulario ahora. hh. valor = diferenciar minuto
if(convertSecond?!=?DifferSecond)? documento .formulario ahora .mm valor = diferenciar segundo
documento formulario ahora .dSecs
documento ss . p>//?document.formnow.Tnow.value=? ¿Diferentes horarios? ¿diferente? +?Segundos diferenciales? +?dSecs
setTimeout("reloj()", 1000)
}
& lt/script & gt;
& lt/cabeza>
<cuerpo? onload = " reloj(); ¿regresar? ¿En serio? text = " red " & gt
& lt form? name = " formnow " & gt
& lt input? name =" dd "? type="text "? style = " border:0;" ? size = 2>
& ltname="hh"? tipo
="texto "? estilo = "borde:0;"? tamaño = 2 & gt
Horas
& ltEnter? nombre="mm"? tipo="texto"? estilo = "borde:0;"? tamaño = 2 & gt
Minutos
& ltEnter? nombre="ss"? tipo="texto"? estilo = "borde:0;"? tamaño = 2 & gt
Segundo
& lt/formulario & gt;
& lt/cuerpo & gt;
& lt /html>