If in http://jsfiddle.net/MG4hw/12/ http://jsfiddle.net/MG4hw/12/单击红色的“开始”按钮,将显示一个 iframe 元素。当您将鼠标悬停在 iframe 元素上时,它会再次隐藏。到目前为止,这是所需的行为。
然而,不希望的是,每当我打开 iframe 时,它也会被隐藏any下拉菜单并将鼠标悬停在下拉菜单上以选择一个值。经过any我的意思是不仅仅是像选择字段编码的下拉菜单me,但也可以例如自动完成建议网页浏览器与输入字段有关。
至少对于第一种情况(选择字段编码为me),我们假设此类下拉菜单的底层代码如下(如果您设法一直滚动到右侧,您还可以在小提琴中找到相应的生日字段):
<fieldset>
<legend>Geburtstag</legend>
<select name="birthDay" id="birthDay">
<option value="tag">Day</option>
<option value="01">01</option>
<option value="02">02</option>
<option value="03">03</option>
<option value="04">04</option>
<option value="05">05</option>
...
</select>
</fieldset>
当鼠标悬停在下拉菜单上时,如何防止 iframe 消失?
预先非常感谢您!
这在某种程度上与this https://stackoverflow.com/questions/6212309/problem-with-jquery-mouseleave-firing-when-container-has-select-box问题。不要问我为什么,但是this http://jsfiddle.net/honk1/MG4hw/13/对我有用。
$('#iframe_register').on("mouseleave", function (e) {
if(e.relatedTarget != null) {
$(this).hide();
}
});
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)