简体   繁体   English

带有Java脚本的网页在Firefox中不起作用

[英]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的“检查元素”,似乎除去了targettitle属性似乎可以解决问题。

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.

相关问题 Firefox扩展,可在网页中编写脚本 - Firefox extension to write a script in a web page 与PDF文档关联的Java脚本在网页中不起作用 - Java script associated with the PDF document not working in a web page java脚本退格和删除在IE中工作,而不是在FireFox中 - java script backspace and delete working in IE,not in FireFox window.location.reload(); 无法在 Google Apps 脚本 web 应用程序中工作。 不刷新但空白页。 (Chrome 和 Firefox;IE 工作正常) - window.location.reload(); not working in a Google Apps Script web application. Not refreshing but blank page. (Chrome and Firefox; IE is working) 如何将消息从Firefox框架脚本发布到网页? - How to postMessage from Firefox frame-script to a web page? Firefox web 扩展,内容脚本注册示例不适用于其他网站 - Firefox web extension, content script registration example not working for other websites Web-Push通知脚本适用于Firefox但不适用于Chrome - Web-Push notification script working on Firefox but not on Chrome Firefox扩展中的“显示/隐藏”按钮在特定网页上不起作用 - Showing/Hiding button from firefox extension not working on specific web page 从Java脚本将数组加载到网页 - Loading an Array from Java Script into Web page 使用Java脚本进行网页重定向 - Web Page Redirection Using Java Script
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM