jQuery - unbind or rebind hoverIntent()?

前端 未结 4 2001
小蘑菇
小蘑菇 2020-12-14 23:33

I have a menu bar that displays a set of categories in an upper row.

One of the categories has a set of sub-categories.

I have a hoverIntent setup so that it

4条回答
  •  心在旅途
    2020-12-14 23:47

    to bind and unbind the hoverIntent you should do:

    // bind the hoverIntent
    $("#demo1 li").hoverIntent(makeTall, makeShort)
    // unbind the hoverIntent
    $("#demo1 li").unbind("mouseenter").unbind("mouseleave");
    $("#demo1 li").removeProp('hoverIntent_t');
    $("#demo1 li").removeProp('hoverIntent_s');
    // rebind the hoverIntent
    $("#demo1 li").hoverIntent(makeTall, makeShort)
    

提交回复
热议问题