I need to stop the mouseover event if a condition is true and I don’t really now how. I ‘ve made this:
$('body').mouseover(function() {
if ($('span.done').length > 0) {
alert('done!');
}
});
after the alert() is called, the mouseover should stop, and stop calling the allert.
Any help is much appreciated. Thanks.
Look at jquery .one() event handler. Doc is here.