I need to disable a function in jquery, for example, when I click on a div, a function that I set will no longer be executed, just when I click on another div it works again. The function loads when the site loads. I need when I click on a div this function does not work anymore, just when you click on another div it comes back.
function executar_whell() {
function debounce(fn, delay) {
var timer = null;
return function () {
var context = this, args = arguments;
clearTimeout(timer);
timer = setTimeout(function () {
fn.apply(context, args);
}, delay);
};
}
var scrollervateira = debounce(function (event) {
if (event.originalEvent.wheelDelta >= 0) {
$('.flexhome').flexslider('prev');
console.log('passa_slide');
return false;
} else {
$('.flexhome').flexslider('next');
console.log('volta_slide');
return false;
}
}, 250);
$(window).bind('mousewheel', scrollervateira);
}
;
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
The run_whell function will not work when I click on a div (div onclick = otherfunno) and when I click on another div (div onclick-work) it will work again.