Jquery Image Animation - Jquery

image animation

Snippet Code


  
Rate this page :
  [ 0 votes]

This animates the image by extending and reducing the width.

<html> <head> <script type="text/javascript" src="jquery-1.2.6.min.js"></script> <script type="text/javascript"> function change(img) { $(img).animate( {width:" =150px"}, 500 ); } function fetch(img) { $(img).animate( {width:"-=150px"}, 500 ); } </script> </head> <body> <div id="test" style="width:600px; height:600px;"> <img src="cat1.jpg" onmouseover="change(this)" id=imgch onmouseout="fetch(this)" style="width:400px; height:400px;"> </div> </body> </html>

Tags


Ask Questions

Ask Question