作者:文艺犯 | 来源:互联网 | 2023-09-17 14:07
SoIcreatedasimplelittlehover,thatusesaclassfromalinktoshowadivunderneath.所以我创建了一个
So I created a simple little hover, that uses a class from a link to show a div underneath.
所以我创建了一个简单的小悬停,它使用链接中的一个类来显示下面的div。
The show/hide works fine, but I can't figure out how to set it so that if the mouse is over the div, it wont hide. I tried using (this) and .hover, with no success.
显示/隐藏工作正常,但我无法弄清楚如何设置它,以便如果鼠标在div上,它不会隐藏。我尝试使用(this)和.hover,但没有成功。
Here is my code:
这是我的代码:
$(document).ready(function()
{
// hide all dropdown
$("#dropdown1").hide();
//hover show dropdown
$(".menu-level-one").hover(
function () {
$("#dropdown1").show();
},
function () {
var postTimer1 = setTimeout(function(){ $("#dropdown1").hide(); }, 1000);
}
);
});
1 个解决方案