PDA

View Full Version : Resizing image with OnMouseover


Yardgnome
05-16-2003, 02:07 AM
I'm trying to write a script that will resize an image when you move your mouse over it.... basically when you move your mouse over an image.... it gets bigger... then goes back to it's original size when you move your mouse away.... can anyone help?

chrismiceli
05-16-2003, 03:28 AM
simple

function resizeL(img) {
img.height += "25";
img.width += "25";
}
function resizeS(img) {
img.height -= "25";
img.width -= "25";
}

<img onMouseOver="resizeL(this)" onMouseOut="resizeS(this">

cheesebagpipe
05-16-2003, 06:38 AM
http://www.javascript-fx.com/navigation/imagezoom/demo1.html :cool:

Yardgnome
05-16-2003, 08:13 PM
Sweet... just what I was looking for... thanks

liorean
05-16-2003, 08:25 PM
How about a stylesheet?

img:hover {width: auto; height: auto;}
img {width: 20px; height: 20px;}