Ver Mensaje Individual
  #2 (permalink)  
Antiguo 06/10/2008, 14:04
Avatar de the_web_saint
the_web_saint
 
Fecha de Ingreso: mayo-2008
Ubicación: localhost/tierra/america/panama
Mensajes: 1.229
Antigüedad: 16 años, 10 meses
Puntos: 43
Respuesta: Contador asi atras

Creo que el error esta en la linea if(m==0 && h!=0), ya que si los minutos no son cero o la hora es cero, entrara al else.
Creo que deberias colocar ese t=true en otro if y no como else de esa condición.
por ejemplo:

Código PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html xmlns="http://www.w3.org/1999/xhtml">
<
head>
<
meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<
title>Untitled Document</title>
<
script>
var 
h=0;
var 
m=0;
var 
s=4;
var 
t=false;
function $(
id){ 
    return 
document.getElementById(id);     

function 
verificar_fecha(){
if(
t){
$(
'fecha').innerHTML="Cuenta finacilzada";
}else{
s--;
if(
s==&& m!=0){
m--;
s=60;
}
if(
m==&& h!=0){
h--;
m=60;
}
alert(m+" "+h+" "+s);
if(
m==&& h==&& s==0)
{
t=true;
}

contar_tc=setTimeout('verificar_fecha()',1000);
$(
'fecha').innerHTML=h+":"+m+" @ "+s;
}
}
</script>
</head>

<body>
<a href="#" onClick="verificar_fecha();">Contar</a><br>
<br>
<div id="fecha">0:0 @ 4</div>
</body>
</html> 
__________________
..::The Saint::..
El pesimista se queja del viento; el optimista espera que cambie; el realista ajusta las velas.