我在检查 IE8 中 div 的状态时遇到问题。我想检查鼠标当前是否悬停在某些 div 上。目前在 IE8 中,我收到以下错误: Syntax error, unrecognized expression: hover
. 下面是导致错误的jQuery:
// This function will close the slideout of widgets
function CloseWidgetPanel()
{
if (!$("#widgets").is(":hover") && !$(".widgetPanel").is(":hover"))
{
if ($("#widgets").is(":animated"))
{
$("#widgets").stop(true, true);
}
$("#widgets").hide("slide", { direction: "right" }, 300);
}
else
{
// We are currently hovering over a panel, so check back in 2 seconds.
setTimeout(CloseWidgetPanel, 2000);
}
}