View Full Version : onMouseOver Image Rollovers

07-25-2002, 05:37 PM
I am not very experienced with javascript and got stuck doing the following. I have placed some image rollovers on one of my pages..where when a user rolls over some text links..and image appropriate to that text is showen...when the mouse moves away from the links then a blank image is displayed as a place holder. this is all simple...here is where i am stuck. The place holder has a specific size...but the rest of the images that are displayed when the text is rolled over have different sizes, some are vertical some are hortizontal. i do not want to have to resize every image so that it properly fits the place holder...add the white borders and so on...so that the image is dispalyed properly.
Is there a way to have the size be changed for each image...so that the size doesnt get inherited from the place holder, but so that the script applies the size associated with each individual image.
place holder is 20 x 20
image 1 is 100 x 200
image 2 is 200 x 100
the place holder is loaded...when the mouse moves over the first link...image 1 replaces the place holder...but instead of taking on the size of 20x20 it has to be displayed at its own size of 100 x 200...
how can i do this?
thank you for all of your help

03-28-2010, 03:11 PM
Good luck with that prob, maybe you could mail me when you get the answer! It's a very interesting question.

What I was looking for was a simple script That showed a pic on a button, then when moused over would change to a second pic.
Finally when clicked; I want it to follow a link

Any ideas?

03-29-2010, 04:25 PM
One solution would be not to replace your place holder but to show image over it, centered on the holder or aligned as needed.
Make position absolute, get the coordinates of your holder and set left (and) top of your image appropriately.

If you need some example code I could write it, tho time is of the essence ;)