当我将鼠标悬停在链接上时,会出现顶部提示。这些工具提示显示列标题的过滤选项。工具提示包含文本、下拉列表或文本框。在 Firefox 和 Chrome 中,CSS 工作正常,但在 IE7+ 中存在问题。
-
工具提示显示在页面上所有其他对象的顶部(正如它应该的那样),除了原始锚链接和您将鼠标悬停在其上的图像之外。它们呈现在工具提示及其内容的顶部。
-
当包含下拉列表时,当鼠标光标打开下拉列表并移动到 DDL 的列表框时,工具提示会消失。我假设当光标移动到列表上时,它不再悬停在工具提示上,并且它会关闭。 IE 无法告诉工具提示,当鼠标悬停在 DDL 列表上时,它实际上悬停在工具提示本身上。
我的 CSS 非常简单:
ul li a:hover { background: #88f; border-style: none; }
.tooltip{
z-index:25;
border: none;
color: inherit;
}
.tooltip:hover { z-index:25; position:relative;}
.tooltip span.tooltip_actual { display: none; }
.tooltip:hover span.tooltip_actual {
display:block;
position:absolute;
top:-1em; left: -42em; width: 40em;
border:1px solid #000;
background-color: #fff; color:#000;
text-align: left; padding: 1em;
}
以前有人遇到过这个问题吗?有解决方法吗?
编辑:这是工具提示错误:
编辑#2:这是我的代码示例:http://jsfiddle.net/NAXrc/
I have tooptips show up when hovering over a link. These tooltips show filtering options for column headers. A tooltip contains text, a drop down list or a text box. In Firefox and Chrome the CSS works fine, however in IE7+ there are problems.
-
The tooltip appears over top all other objects on the page (as it's supposed to) except the original anchor link and image that you hover over. These get rendered over top the tooltip and it's contents.
-
The tooltip, when containing a dropdown list, disappears when the mouse cursor opens the drop down list and moves onto the DDL's listing box. I'm assuming that when the cursor moves over the list, it no longer is hovering over the tooltip, and it closes. IE has problems with telling the tooltip that when hovering over the DDL's list, that its actually hovering over the tooltip itself.
My CSS is very straight forward:
ul li a:hover { background: #88f; border-style: none; }
.tooltip{
z-index:25;
border: none;
color: inherit;
}
.tooltip:hover { z-index:25; position:relative;}
.tooltip span.tooltip_actual { display: none; }
.tooltip:hover span.tooltip_actual {
display:block;
position:absolute;
top:-1em; left: -42em; width: 40em;
border:1px solid #000;
background-color: #fff; color:#000;
text-align: left; padding: 1em;
}
Has anyone run into this issue before and is there a work around?
EDIT: this is the tooltip bug:
EDIT #2: Here is an example of my code: http://jsfiddle.net/NAXrc/
发布评论
评论(1)
IE7 存在
z-index
的已知错误。如果你能提供一个测试用例,我也许可以给你更好的答案。
否则,我所能做的就是向您指出这些资源:
这些问题在IE8/9中应该不存在。您的页面没有使用IE8/9标准模式吗?
如果您的页面使用兼容模式(模拟 IE7)或怪异模式,则可以解释为什么比 7 新的版本也会出现此问题。
IE7 has known bugs with
z-index
.If you can provide a test case, I can probably give you a better answer.
Otherwise, all I can do is point you to these resources:
These problems should not exist in IE8/9. Is your page not using IE8/9 Standards Mode?
If your page is using Compatibility Mode (which emulates IE7) or Quirks Mode, that would explain why versions newer than 7 are also exhibiting the problem.