All pastes #631204 Raw Edit

codeee

public text v1 · immutable
#631204 ·published 2007-07-23 20:07 UTC
rendered paste body
<html>
  <head>
    <script>
 
    var delta_y = 5; //La velocidad es delta_y/delta_t (En pixels / microsegundo)
	var delta_t = 20;
	var pausa = false;
 
    onload = function() {
	  var con = document.createElement("div");
	  con.style.position = "absolute";
	  con.style.left= "100px";
	  con.style.top= "50px";	  
	  con.style.width  = "600px";
	  con.style.height = "400px";
	  con.style.border = "1px solid black";
	  con.style.overflow = "hidden";
	  document.body.appendChild(con);
 
	  var mov = document.createElement("img");
	  mov.src="desliz_link_stop2_files/bola.jpg";
	  mov.style.position = "relative";
	  mov.style.left= "10px";
	  mov.style.top = "20px";	
	  mov.onmouseover = function (event) {
        pausa = true;
	  }
	  mov.onmouseout = function (event) {
        pausa = false;
		paso();
	  }
	  mov.onclick = function (event) {
        window.location = "desliz_link_stop2_files/bola.jpg";
	  }
 
	  con.appendChild(mov);
 
	  var x = 10;
	  var y = 20;
 
 
	  function paso() {
	    y+=delta_y;
		y = y%400;
 
	    mov.style.top = y+"px";
		if (!pausa)
		setTimeout(paso,delta_t);
		
	  }
		
	  paso();
 
	}
    </script>	
		
  </head>
  <body>
 
  </body>
</html>