Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Javascript newbie question

Status
Not open for further replies.

benrob82

Programmer
Jul 28, 2005
116
0
0
GB
Hi I want to be able to roll over a link but also display an image when the link is rolled over.

does anyone know how to do this?

thanks
 
Where will the image display?
Or are you using an image as a link and want to change the image for that link?
Or are you displaying the image in another location when the link is moused over?


It's hard to think outside the box when I'm trapped in a cubicle.
 
hi,

the image will display when the user mouses over the link and will appear at the point of the mouse
 
Then you need some tooltip code in order to track the mouse position and set the coordinates for the image box to appear. That is much more complex than just displaying the image but there are plenty of existing scripts around for tooltips.
Essentially it will just position a div on the screen relative to the element you are hovering over and then make that div visible, generally with text inside it. Once you have the tooltip code working it should not be difficult to replace the text in the div with an image but you will have to get your tooltip code first.


It's hard to think outside the box when I'm trapped in a cubicle.
 
Your welcome.
I see on that link they even include the possibility of images in the code already so you should not have to make much in the way of alterations.

It's hard to think outside the box when I'm trapped in a cubicle.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top