简体   繁体   English

IE7,悬停div仅对鼠标越过边界做出反应

[英]IE7, hover divs only react to mouse over border

I'm using jQuery UI to overlay divs. 我正在使用jQuery UI来覆盖div。 The HTML looks like this: HTML看起来像这样:

<div id="s7Wrapper" style="position: relative; width: 722px; height: 500px; text-align: center; margin-left: 39px; overflow-x: hidden; overflow-y: hidden; pointer-events: auto; ">
            <div id="center">
                <img class="s7urlloading" src="3.gif" style="position: absolute; width: 32px; height: 32px; z-index: 4000; margin-left: 344.94701910014567px; margin-top: 233.99999999999997px; display: none; ">
                <img class="s7url" src="'http://google.com" style="left: 0px; top: 0px; height: 499.99999999999994px; width: 721.8940382002913px; ">
            <div id="tooltip" class="text_7 ui-draggable" style="position: absolute; width: 247px; height: 53px; left: 20px; top: 403px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; border-top-color: white; border-right-color: white; border-bottom-color: white; border-left-color: white; border-image: initial; "></div>
<div id="tooltip" class="text_6 ui-draggable" style="position: absolute; width: 246px; height: 33px; left: 22px; top: 353px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; border-top-color: white; border-right-color: white; border-bottom-color: white; border-left-color: white; border-image: initial; "></div>
<div id="tooltip" class="text_5 ui-draggable" style="position: absolute; width: 248px; height: 51px; left: 20px; top: 291px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; border-top-color: white; border-right-color: white; border-bottom-color: white; border-left-color: white; border-image: initial; "></div>
</div>
</div>
</div>

These ui-draggable divs will only react to a mouseover when I place my mouse pointer directly on the 1px border. 当我将鼠标指针直接放在1px边框上时,这些ui可拖动的div只会对鼠标悬停做出反应。 This only happens in IE. 这只发生在IE中。

The problem was solved by adding a 1x1 transparent 100% width x 100% height png onto the divs. 通过在div上添加1x1透明100%宽度x 100%高度png来解决该问题。 Apparently IE does not recognize the divs as hover-able elements if there is not some content inside of the div. 显然,如果div中没有​​一些内容,IE不会将div识别为可悬停的元素。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM