![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
25/05/2014, 09:20
|
| | Fecha de Ingreso: febrero-2013
Mensajes: 264
Antigüedad: 12 años Puntos: 1 | |
Respuesta: un simple contador atrás Vale ya lo he encontrado lo he encontrado en ingles :
<!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>JavaScript 5 Seconds Countdown</title>
<script language="javascript">
var max_time = 5;
var cinterval;
function countdown_timer(){
// decrease timer
max_time--;
document.getElementById('countdown').innerHTML = max_time;
if(max_time == 0){
clearInterval(cinterval);
}
}
// 1,000 means 1 second.
cinterval = setInterval('countdown_timer()', 1000);
</script>
</head>
<body>
<p>Download will start in <span id="countdown">5</span> seconds.</p>
</body>
</html> |