HoverIntent ClearTimeout

核能气质少年 提交于 2019-12-11 13:12:26

问题


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.


回答1:


Upon further research, I found that the timeout is stored as an attribute of the HTML element hoverIntent was applied to. So in order to clear the timeout do the following.

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

Keep in mind however, that each element will have it's own timeout attached to it. So to stop hoverIntent all together, you'll want to do the following:

$(this).siblings().each(function () {
    clearTimeout($(this).parent().children().attr("hoverIntent_t"));
});


来源:https://stackoverflow.com/questions/5378523/hoverintent-cleartimeout

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!