Guest User

Untitled

a guest
May 27th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. <html>
  2. <head>
  3. <link href="style.css" rel="stylesheet" type="text/css" />
  4. <title>World Edit</title>
  5. </head>
  6. <body>
  7. <div id="map">
  8. <div id="mario" style="position:fixed;top:250px;left:15px;" onclick="javascript:move();"></div>
  9. <div id="pont"></div>
  10. </div>
  11.  
  12. <script>
  13.  
  14. function movef(i,x)
  15. {
  16. var mario = document.getElementById('mario');
  17. var mario_pos = mario.getAttribute('style');
  18. var left = 15;
  19. //alert("DEBUG: "+x);
  20. mario.setAttribute('style', 'position:fixed;top: '+x+'px;left:15px;');
  21. if(x <= i)
  22. {
  23. var tmp = x + 1;
  24. setTimeout("movef("+i+","+tmp+");", 10);
  25. }
  26. }
  27. function move()
  28. {
  29. var x = 250 +parseInt(prompt("Avancer de combien de pixel ?"))
  30. movef(x, 250);
  31. }
  32. </script>
  33. </body>
  34. </html>
Add Comment
Please, Sign In to add comment