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

Disjointed rollovers images with text

Status
Not open for further replies.

manj

Programmer
Sep 22, 2000
28
GB
I have a series of text hyperlinks which all have an associated image. Upon rolling over the text links I wish the associated image to appear. All images will appear in the same area.

Can anybody help?
Cheers [sig][/sig]
 
Display a dummy image on the page. Then use the mouseover event of the hyperlink to dynamically change that image to any other image. Here's a sample:
<img name=&quot;I1&quot; src=&quot;dummy.jpg&quot;>
<a href=&quot;anypage.html&quot; onMouseOver=&quot;changeimage()&quot; onMouseOut=&quot;restoreimage()&quot;>
in scripts:
function changeimage()
{
a=new Image();
a.src=&quot;newimage.jpg&quot;;
I1.src=a.src;
}
You can write the restoreimage() yourself.
You'll have to write a different changeimage() for each hyperlink or you can write one func and pass the name of the image file as argument.
Good luck,
Ciao.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top