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

OnMouseOver w/<map>

Status
Not open for further replies.

Soti

Programmer
Jul 9, 2001
34
US
I want to flip (individual) images in an image map. I can't figure out how to do it. Does anyone know if this is possible? If so, can you provide a starting point?
Thanks!
 
I did this a few years back.

I think what I did was go into the <map> in each of the <area> tags I put the Onmouseover=&quot;<<NAME_OF_FUNCTION_HERE>>()&quot;

I.E.
I use Dreamweaver so it does this
onMouseOver=&quot;MM_swapImage('NameofImage','','../images/newimagename.gif',1)&quot; onMouseOut=&quot;MM_swapImgRestore()&quot;

Hope this helps.
 
I have done this and it is not functioning properly, any idea what the problem is?

<map name=&quot;Nav_Bar1&quot;>
<area shape=&quot;rect&quot; alt=&quot;Sofa&quot; coords=&quot;2,8,75,51&quot; href=&quot;sofas.shtml&quot; title=&quot;Sofa&quot; onMouseOver=&quot;Generic_Images/sofanavbarrollover-opt.gif&quot;>
<area shape=&quot;rect&quot; alt=&quot;Lighting&quot; coords=&quot;84,9,159,51&quot; href=&quot;lighting.shtml&quot; title=&quot;Lighting&quot; onMouseOver=&quot;Generic_Images/lightnavbarrollover.JPG&quot;>
<area shape=&quot;rect&quot; alt=&quot;Chairs&quot; coords=&quot;166,7,240,53&quot; href=&quot;chairs.shtml&quot; title=&quot;Chairs&quot; onMouseOver=&quot;chairnavbarrollover.jpg&quot;>
<area shape=&quot;rect&quot; coords=&quot;247,9,319,54&quot; href=&quot;Generic_Images/casedgoods.shtml&quot; title=&quot;&quot; onMouseOver=&quot;cgnavbarrollover.JPG&quot;>
<area shape=&quot;rect&quot; alt=&quot;Tables&quot; coords=&quot;327,8,404,52&quot; href=&quot;tables.shtml&quot; title=&quot;Tables&quot; onMouseOver=&quot;Generic_Images/tablenavbarrollover.JPG&quot;>
<area shape=&quot;rect&quot; alt=&quot;Beds&quot; coords=&quot;411,10,483,50&quot; href=&quot;beds.shtml&quot; title=&quot;Beds&quot; onMouseOver=&quot;Generic_Images/bednavbarrollover.JPG&quot;>
<area shape=&quot;rect&quot; alt=&quot;Linens&quot; coords=&quot;491,7,564,51&quot; href=&quot;linens.shtml&quot; title=&quot;Linens&quot;>
<area shape=&quot;rect&quot; alt=&quot;Contact Us&quot; coords=&quot;575,6,645,52&quot; href=&quot;contactus.shtml&quot; title=&quot;Contact Us&quot; onMouseOver=&quot;Generic_Images/contactnavbarrollover.JPG&quot;>
</map>
 
You need to have the onmouseover event linking to a java function. In the sample I posted earlier, it calls MM_swapImage. Simply putting in the image you want to display with a rollover will not work. What HTML editor are you using? to the best of my knowledge most will have built in rollovers for images (I know for a fact Dreamweaver does)! But if not you could check out or &quot;Matt's Script Archive&quot; to find a rollover script to use.

Hope this helps.
 
Hi-I use textpad, although I did try dreamweaver and it does not seem to provide rollovers for image maps, just for single images. I've looked all over the internet for a script to use on an image map and haven't found any, that's why I'm wondering if it could be done. Actually, I've found scripts that will flip the entire image, I don't want that to happen, I want to flip individual parts of an image.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top