通过鼠标悬停事件显示效果在FF中不起作用 [英] Showing effects via mouseover event not working in FF

查看:123
本文介绍了通过鼠标悬停事件显示效果在FF中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在努力解决Javascript中的事件模型处理问题

只出现在Firefox中。我有两个小网站我想要你

看看:


http://gis.cbmiweb.com/MexicoExported/default .asp


http://gis.cbmiweb.com/MDWmaps/default.asp


该问题涉及背后的代码。缩放框

"工具栏上的图标靠近每页顶部。在上面的两个页面上,ZoomBox

图标是左边缘的第4个小图标(悬停将显示

工具提示)。点击

这个图标设置一个模式。 缩放框的缩写反映在上面的方框中

版权归底部所有。此时预期的

行为是用户在地图上拖动鼠标。

此框的区域。成为地图的新边界。


如果你在我的墨西哥上试试这个上面的链接应该可以工作(也就是说,当你在屏幕上的某个位置拖动它时,用户应该能够看到框的边界)。


如果你在我上面的MDWmaps链接上尝试相同的技术,它会缩放到所需的盒子位置,但是band和band。或框的边界

未显示。我需要这个网站显示盒子乐队,因为它是

" drawn" - 就像它适用于墨西哥地图一样。


奇怪的是,处理此功能的代码部分是

在两个示例中基本相同(主要区别在于我将原始default.asp划分为几个包含的.js文件。


这部分DOM和事件模型对我来说,IE和FF是一个真正的延伸

(在这两种情况下我都没有写这个代码;我继承它。)


我尝试过使用Firebug在鼠标悬停事件中设置断点

处理程序,但我无法在管理

鼠标和调试的同时猜测。


这是我认为是问题的事件处理程序:

I am struggling with a event model handling problem in Javascript that
shows up only in Firefox. I have 2 little websites I''d like you to
take a look at:

http://gis.cbmiweb.com/MexicoExported/default.asp

http://gis.cbmiweb.com/MDWmaps/default.asp

The issue involves the code behind the "Zoom Box" icon on the
"toolbar" near the top of each page. On both pages above, the ZoomBox
icon is the 4th little icon from the left edge (hover will expose a
tooltip). Clicking
this icon sets a "mode" of "Zoom Box" reflected in the box just above
the Copyright at the bottom. The expected
behavior at this point is for the user to drag the mouse on the map.
The area of this "box" becomes the
new boundaries of the map.

If you try this on my "mexico" link above it should work (that is, you
the user should be able to see the boundaries of the box as you drag
it somewhere on the screen).

If you try the same technique on my MDWmaps link above, it zooms to
the desired box location but the "bands" or boundaries of the "box"
are not shown. I need this site to show the box bands as it is being
"drawn" - just like it works for the Mexico map.

Curiously, the part of the code that handles this functionality is
essentially the same in both examples (the major difference is that I
divided an original default.asp into a couple of included .js files).

This part of the DOM and event models of IE and FF are a real stretch
for me (I did not write this code in either case; I "inherited" it).

I tried using Firebug to set breakpoints in the mouseover event
handler but I couldn''t get the hang of managing the
mouse and debugging at the same time I guess.

Here is the event handler that I think is the problem:

展开 | 选择 | Wrap | 行号

推荐答案

我不是一个js家伙,但你没有在你的页面上使用doctype。这使IE成为怪异模式和破碎的盒子模型。这就是为什么我想知道这是否与边界不正常有关。在任何情况下,所有网页都需要一个适当的doctype,这是你应该使用的:

<!DOCTYPE html PUBLIC" - // W3C // DTD HTML 4.01 // EN"

" http://www.w3.org/TR/html4/strict.dtd">
I''m not a js guy but you aren''t using a doctype for your page. This puts IE into quirks mode and the broken box model. This is why I''m wondering if this has something to do with the borders not working right. In any case, all web pages need a proper doctype and this is the one you should use:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">


我从未遇到过javascript问题我没有把doctype作为标准。 IE6 xp service pack 2,对我来说都很好。它显示了边界框。
I''ve never had a javascript problem cause I didn''t put doctype anyways thats standard. IE6 xp service pack 2, worked fine for me bud on both of them. it showed the bounding box.


doctype将影响html和css的显示方式。所有现代网页都需要它们。
The doctype will affect how html and css are displayed. All modern web pages require them.


这篇关于通过鼠标悬停事件显示效果在FF中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆