gpt4 book ai didi

jquery - 将鼠标悬停在整个 div 上时,在 IE 中悬停不起作用

转载 作者:行者123 更新时间:2023-12-01 07:01:22 24 4
gpt4 key购买 nike

我使用 jquery addClass 代码在滚动 div 时显示/隐藏元素。在所有浏览器中它都有效,但在 IE 中它仅在我滚动某些文本而不是完整的 div 时才有效。

因此,在这个示例中,如果我将鼠标悬停在主 div 的显示文本部分,隐藏文本 div 将显示。但是如果我将鼠标移入两个 float div 之间的空间(其中现在有文本或任何内容),则悬停不起作用。

更新:下面的代码似乎可以工作,但我的生产代码却不能。请引用此链接:jsfiddle.net/H2anm/5有一些损坏的图像等,但是如果您将鼠标滑过元素,进入用户名、位置坐标和 Pref.brand: Gamehouse.. 或共享/书签周围的一些空白区域右侧的空白区域链接,div 折叠,按钮/背景颜色更改消失。

JavaScript:

$(function() {
$("div.DivThatsTriggeredOnRollover").hover(
function() { $("div.hiddentext").addClass("hiddentextShow"); },
function() { $("div.hiddentext").removeClass("hiddentextShow"); });
});

伪html代码:

<div class="DivThatsTriggeredOnRollover" style="width:500px;">

<div id="showingtext" style="float:left;width:100px;">
here is showing text
</div>

<div class="hiddentext" style="float:right;width:100px;">
here is hidden text
</div>

</div>

最佳答案

实际上,一切都按预期工作(在 IE6-7-8 中测试):

http://jsfiddle.net/ZDyyU/

如果您将鼠标悬停在 .DivThatsTriggeredOnRollover 内的任何内容上,.hiddentext 将在您将鼠标移开时显示和隐藏。 .showingtext 与此无关,它就在那里。

关于jquery - 将鼠标悬停在整个 div 上时,在 IE 中悬停不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3550259/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com