Foros del Web » Programando para Internet » Javascript »

[Ayuda] Cuenta regresiva

Estas en el tema de [Ayuda] Cuenta regresiva en el foro de Javascript en Foros del Web. Hola amigos tengo el siguiente codigo: Código PHP: < center > < font face = "Arial" >< b > You will be redirected to the script in < br >< br > < ...
  #1 (permalink)  
Antiguo 06/03/2011, 15:05
Avatar de Algrox  
Fecha de Ingreso: septiembre-2010
Mensajes: 39
Antigüedad: 13 años, 7 meses
Puntos: 1
[Ayuda] Cuenta regresiva

Hola amigos tengo el siguiente codigo:
Código PHP:
<center>
<
font face="Arial"><b>You will be redirected to the script in<br><br>
<
form>
<
input type="text" size="3" name="redirect2">
</
form>
seconds</b></font>
</
center>

<
script>
<!--

/*
Count down then redirect script
By JavaScript Kit (http://javascriptkit.com)
Over 400+ free scripts here!
*/

//change below target URL to your own
var targetURL="http://javascriptkit.com"
//change the second to start counting down from
var countdownfrom=10


var currentsecond=document.redirect.redirect2.value=countdownfrom+1
function countredirect(){
if (
currentsecond!=1){
currentsecond-=1
document
.redirect.redirect2.value=currentsecond
}
else{
window.location=targetURL
return
}
setTimeout("countredirect()",1000)
}

countredirect()
//-->
</script> 
Quisiera saber si es posible imprimir la cuenta regresiva sin el textbox.
Al estilo megaupload

Bueno les agradezco de antemano :)
  #2 (permalink)  
Antiguo 06/03/2011, 15:16
Avatar de IsaBelM
Colaborador
 
Fecha de Ingreso: junio-2008
Mensajes: 5.032
Antigüedad: 15 años, 10 meses
Puntos: 1012
Respuesta: [Ayuda] Cuenta regresiva

crea un div y le pones como id el nombre del textbox. ahora en js usa getElementById('').innerHTML, en lugar de redirect.redirect2.value

Etiquetas: contador, count, megaupload, regresiva
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 23:34.