Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE HTML>
- <html>
- <head>
- <style>
- #train {
- position: relative;
- cursor: pointer;
- }
- </style>
- </head>
- <body>
- <img id="rocket" src="https://kartinki.org/uploads/posts/2017-09/1505354537_2831-raketa-vzletaet.gif">
- <script>
- var start = 200; // сохранить время начала
- var timer = setInterval(function() {
- start += 5;
- document.getElementById("rocket").style.marginLeft = start + 'px';
- if (start > 2000) clearInterval(timer);
- }, 20);
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement