PDA

View Full Version : Animated Rollovers



xkyogre
07-01-2007, 04:15 PM
Is it possible to make animated rollovers on JavaScript?How?

Trinithis
07-01-2007, 06:48 PM
<img src="test.bmp" alt=""
onmouseover="(function(img){img.src='test2.bmp'})(this)"
onmouseout="(function(img){img.src='test.bmp'})(this)"
/>

mwinter
07-01-2007, 06:51 PM
<img src="test.bmp" alt=""
onmouseover="(function(img){img.src='test2.bmp'})(this)"
onmouseout="(function(img){img.src='test.bmp'})(this)"
/>


Why so complicated?



<img alt="..." src="..." onmouseover="this.src = '...';" onmouseout="this.src = '...';">

There are more scalable approaches, but this is fine for a few instances.

Trinithis
07-01-2007, 11:13 PM
I forgot about using non-functions.:p