【发布时间】:2013-06-11 11:55:56
【问题描述】:
当鼠标停留在slide div 上时,slide_panel div 将变得可见。
但是,当鼠标随后退出slide div 并位于slide_panel 中的内容上方时,面板不 仍然可见。
那么,一旦面板最初可见,如何保持切换面板在mouseover 上可见?
HTML:
<div class = "slide">category:</div>
<div class = "slide_panel">
<a href = "#" title = "">asdf</a><br />
<a href = "#" title = "">qwerty</a><br />
</div>
<div class = "slide">another category:</div>
<div class = "slide_panel">
<a href = "#" title = "">another asdf</a><br />
<a href = "#" title = "">another qwerty</a><br />
</div>
jQuery:
$(".slide").mouseover(function() {
$(this).next(".slide_panel").slideToggle();
}).mouseout(function() {
$(this).next(".slide_panel").slideToggle();
});
编辑:
我希望
slide_panel 然后在 mouseout 上消失,本质上就像一个下拉菜单。
【问题讨论】:
-
离开元素时使用超时,应该是 700 毫秒。如果鼠标进入面板,则清除超时,否则,让超时结束并隐藏面板。
-
谢谢@Ohgodwhy,但是我希望隐藏面板在
slide_panel的mouseover上无限期保持可见.. -
$('.slide_panel') 何时可见?
标签: jquery mouseover slidetoggle mouseout