1

How do I clear the timeout built-in to hoverIntent? I'd like to do it from within the over section of the same hoverIntent.

4

1 回答 1

1

经过进一步研究,我发现超时存储为应用了 HTML 元素 hoverIntent 的属性。因此,为了清除超时,请执行以下操作。

clearTimeout($(this).attr("hoverIntent_t"));

但是请记住,每个元素都有自己的超时时间。因此,要同时停止 hoverIntent,您需要执行以下操作:

$(this).siblings().each(function () {
    clearTimeout($(this).parent().children().attr("hoverIntent_t"));
});
于 2011-03-21T18:40:23.177 回答