Tryit Editor v1.4

<html> <head> <script type="text/javascript"> function shakeleft() { document.getElementById('image').style.position="relative"; document.getElementById('image').style.left="3"; timer=setTimeout("shakeright()",10); } function shakeright() { document.getElementById('image').style.left="0"; timer=setTimeout("shakeleft()",10); } function stoptimer() { clearTimeout(timer); } </script> </head> <body> <b>Mouse over the image to see it shake</b><br /> <img id="image" src="smiley.gif" onmouseover="shakeleft()" onmouseout="stoptimer()" width="32" height="32" /> </body> </html> | Your Result:
Edit the code above and click to see the result. | W3Schools.com - Try it yourself