Forum Moderators: open

Message Too Old, No Replies

Linking text and images together

Can anyone help me with this?

         

BeeDeeDubbleU

11:42 am on Jul 21, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I am sure that some of you more experienced HTML people will be able to help me with what I think is a simple problem.

I have a small animated GIF that runs with an image swap on mouseover. It's like a little propellor that turns when the mouse is over it. I use this as a menu link on a site along with adjacent plain text links. Is there any way that I can make it turn when the mouse is over the adjacent text as opposed to just the image?

NOTE: edited for clarity

encyclo

3:23 pm on Jul 21, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What's your Javascript for the image rollover, BDW? Basically, what you need to do is use Javascript on your text link in much the same way, but referring to the image. :)

BeeDeeDubbleU

8:40 pm on Jul 21, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month




I use Dreamweaver, which does not need Javascript to do this.

chriswragg

9:00 pm on Jul 21, 2005 (gmt 0)

10+ Year Member



Dreamweaver does use Javascript for image mouse overs. Look in the <head> section of the page and there should be javascript function starting with MM, like MM_swapImage.

In the <a> tag around you image you should find some thing like:

onMouseOver="MM_swapImage('Name of Image','','Location of Rollover Image',1)"

The MM_swapimage is a javascript function. In the script above, the target image to change is specified (Name of Image in my example) so you should be able to copy this attribute of the tag, and also the
onMouseOut="MM_swapImgRestore()" attribute into the <a> tag of your text link.

For Example this would be the code of the text link:

<a href="http://example.com/index.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image','','rollover.gif',1)">Home</a>

Where Image must be the name of the image you want to change.

Hope this helps

Chris

BeeDeeDubbleU

7:09 am on Jul 22, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month




Thanks Chris. I wasn't thinking right last night when I wrote that. Perhaps it was something to do with the six pints of Guinness that I had just consumed ;)

Anyway, I figured it out in five minutes this morning :)