There are two ways to do this the way I see it without flash.
When you move your mouse over the image; it gradually changes to the hover class. Or when when you hover over the image, the margins change each side going either horizontal either way.
The first way would be better but it is CSS at the end of the day. I want this button to gradually sink when you hover over it – and you move your mouse off, it bounces back:
Html
<center><br /><br />
<a href="#"><img src="//gc-cdn.com/button.png" alt=""></a>
</center>
Css
img{border-right:15px solid #333;border-bottom:15px solid #333}
img:hover{border-right:1px solid #333;border-bottom:1px solid #333}
You don’t need javascript to do this, you can use CSS transitions:
Updated fiddle: http://jsfiddle.net/fk6eG/15/
Edit: For a jquery solution, you could use the jquery UI switch class method:
CSS:
Javascript:
Sample fiddle: http://jsfiddle.net/fk6eG/23/