Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <!--animation example-->
- <title>JavaScript Animation</title>
- <script type="text/javascript">
- <!--
- var imgObj = null;
- function init() {
- imgObj = document.getElementById('myImage');
- imgObj.style.position ='relative';
- imgObj.style.left = '0px';
- }
- function moveRight() {
- imgObj.style.left = parseInt(imgObj.style.left) + 10 + 'px';
- }
- window.onload= init;
- //-->
- </script>
- </head>
- <body>
- <form>
- <img id="myImage" src="c.jpg"/>
- <p>Click the button to move the image to the right</p>
- <input type="button" value="Click Me" onclick="moveRight()"></input>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement