Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <link href="style.css" rel="stylesheet" type="text/css" />
- <title>World Edit</title>
- </head>
- <body>
- <div id="map">
- <div id="mario" style="position:fixed;top:250px;left:15px;" onclick="javascript:move();"></div>
- <div id="pont"></div>
- </div>
- <script>
- function movef(i,x)
- {
- var mario = document.getElementById('mario');
- var mario_pos = mario.getAttribute('style');
- var left = 15;
- //alert("DEBUG: "+x);
- mario.setAttribute('style', 'position:fixed;top: '+x+'px;left:15px;');
- if(x <= i)
- {
- var tmp = x + 1;
- setTimeout("movef("+i+","+tmp+");", 10);
- }
- }
- function move()
- {
- var x = 250 +parseInt(prompt("Avancer de combien de pixel ?"))
- movef(x, 250);
- }
- </script>
- </body>
- </html>
Add Comment
Please, Sign In to add comment