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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I change text with a mouseover? 1

Status
Not open for further replies.

tomk

MIS
Jun 4, 1999
12
US
Can anyone tell me how to change text with a image map mouseover? Basically, I want the text to change when someone hovers about a certain part of the image.

For example, I have a single image that has boxes with different colors. When I put the mouse over the red box, the type below the image says "Red Box", when I put the mouse over the blue box the type says "Blue Box".

Thanks for your help in advance,
Tom
 
if you have a single image and want it to react as many images (one reaction for the blue box, one for the red one...) you have to use IMAGE MAPS
do you want to display actual text or an image with text written on it ?
if you want to display real text then i guess you'll have to enclose the img tag between a div (or span) one. Something like : <div id=foo onmouseover=&quot;this.innerHTML='hey this is a blue box'&quot;><img src=....></div>
if you want to display an image with the text written on it there are plenty of 'image rollovers' free jscript
 
Yes, I want the actual text to change (not a graphic). I know how to do that with mouseovers. I will try your suggestion.

Thanks
 
the code i gave you with the 'div' should be working, but only in ie
 
Iza's example will also work in NS6. jared@aauser.com
 
Realize that this will remove your image also, however. If you want to keep your image and change the text, they should be in separate containers. Just let me know, and I'll help you with that if you need it. jared@aauser.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top