Skip to content Skip to sidebar Skip to footer

How To Undo Jquery's One() Using On()?

I have a click event that needs to be fired not more than once : $('.menuIco').one('click', function() { $(this).menuIcoClick($(this)); }); ...that leads to functi

Solution 1:

You can use the .off inside your first function:

$(".menuIco").on('click', function() {
    $(this).menuIcoClick($(this));
    $(".menuIco").off('click'); // Here we disable the event, on the first execution
});

For do the event again you need to set it into a new function, attached to event that you want.

If this not work, please send us a jsfiddle showing up with more details your problem.

Post a Comment for "How To Undo Jquery's One() Using On()?"