Forum Moderators: open
I tried this code before:
<img src="image_small.jpg" width="550" height="200" onmouseover="this.src='image_big.jpg';this.height=400;this.width=1000" onmouseout="this.src='image_small.jpg';this.height=550;this.width=200" />
But when it enlarges it would expand the page.
Also, if the big image hides the smaller one the user will expect the mouseout to be on the big one. A mouseout on a hidden element would get annoying fast.
CSS is the recommended way of styling/formatting things whenever possible, by the way. HTML attributes and JS are needed for some things, but CSS should be your first try.
[edited by: Jesdisciple at 3:31 am (utc) on June 12, 2009]