Brito
Brito

Reputation: 39

web page with java script not working in firefox

I am using a map on an image. Inside that map I got onmouseover effects for different areas. Also, I have a script that opens an image thumbnail when that area is clicked. This is the script I'm using: http://britobmarketing.com/thumbnailviewer.js

The problem is it's not working in firefox. Not the onmouseover effect, not the thumbnail script. It's simply not working.

Any recommendations?

I really want to stick with java script and not get into Jquery!

Thanks a lot!

Upvotes: 1

Views: 113

Answers (1)

Hawken
Hawken

Reputation: 2119

Assuming that the page you are using this on is: http://britobmarketing.com/


Your problem seems to be with how you are defining your imagemap; not how the javascript is working

Your imagemap setup:

<map name="mainMap">
    <a rel="thumbnail" href="images/contactUsPic.jpg">
        <area onmouseout="document.pic1.src='images/mapPics.gif'" onmouseover="document.pic1.src='images/contactUs.gif'" title="Contact Us" shape="rect" coords="798,481,877,572">
    </a>
    <area target="_blank" href="http://www.facebook.com/britoBMarketing" title="Facebook" shape="rect" coords="884,298,956,357">
</map>

Playing around with Firebug's "inspect element", it seems that stripping out the target and title attributes seems to remove the problem.

Also your main <area/>s are wrapped with anchors (<a>) which is probably preventing them from working.

Try something like this:

<map name="mainMap">
 <area coords="191,138,487,233" shape="rect" href="" onmouseover="alert('hello')">
</map>

Upvotes: 1

Related Questions