Ver Mensaje Individual
  #2 (permalink)  
Antiguo 22/12/2009, 20:20
Avatar de jackson666
jackson666
 
Fecha de Ingreso: noviembre-2009
Ubicación: Buenos Aires, Argentina
Mensajes: 1.971
Antigüedad: 15 años, 3 meses
Puntos: 65
Respuesta: Progressbar en Javascript que pare en 100%

Código HTML:
<!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" xml:lang="en" lang="en">
<head>
	<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
	<meta name="author" content="Jackson666" />

	<title>Untitled 2</title>
<style type="text/css">
*{margin: 0;padding: 0;}
#barra{background-color: black; height:20px; position: absolute; left: 0; top: 20px;}
#contenedor{position: relative; margin: auto; height: 60px; width: 100%;}
</style>
</head>
<body>
<div id="contenedor">
<div id="barra"></div>
</div>
<script type="text/javascript">
var x=0;
window.onload=progress();

function progress(){
    var timer;
   
    if(x<100){
        x++;
        document.getElementById('barra').style.width=x+'%';            
        timer=setTimeout('progress()',50);
    }else{
        clearTimeout(timer);
        location.href='tuPagina.htm';
    }
}
</script>
</body>
</html> 

Última edición por jackson666; 22/12/2009 a las 20:29