[英]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. 在该地图内,我得到了不同区域的onmouseover效果。 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 这是我正在使用的脚本: http : //britobmarketing.com/thumbnailviewer.js
The problem is it's not working in firefox. 问题是它不能在Firefox中使用。 Not the onmouseover effect, not the thumbnail script. 不是onmouseover效果,不是缩略图脚本。 It's simply not working. 这根本不起作用。
Any recommendations? 有什么建议吗?
I really want to stick with java script and not get into Jquery! 我真的很想坚持使用Java脚本,而不要进入Jquery!
Thanks a lot! 非常感谢!
Assuming that the page you are using this on is: http://britobmarketing.com/ 假设您正在使用的页面是: http : //britobmarketing.com/
Your problem seems to be with how you are defining your imagemap; 您的问题似乎与如何定义图像映射有关。 not how the javascript is working 不是JavaScript的工作方式
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. 玩Firebug的“检查元素”,似乎除去了target
和title
属性似乎可以解决问题。
Also your main <area/>
s are wrapped with anchors ( <a>
) which is probably preventing them from working. 同样,您的主要<area/>
包裹着锚点( <a>
),这可能会阻止锚点工作。
Try something like this: 尝试这样的事情:
<map name="mainMap">
<area coords="191,138,487,233" shape="rect" href="" onmouseover="alert('hello')">
</map>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.