How can I disable the wheel event temporarily?
button.addEventListener('click', function() {
clickLog();
button.disabled = true;
setTimeout(() => button.disabled = false, 2000);
});
when a button is p开发者_高级运维ressed, it writes to the console and waits for two seconds. but i want to do this in wheel event.
what I want to do; When the user triggers the wheel event, the image changes, but when triggering multiple wheel events, many images change.To avoid this, only one event should be triggered every 2 seconds, no matter how many.
精彩评论