开发者

How can I disable the wheel event temporarily?

开发者 https://www.devze.com 2022-12-07 18:27 出处:网络
button.addEventListener(\'click\', function() { clickLog(); button.disabled = true; setTimeout(() => button.disabled = false, 2000);
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.

0

精彩评论

暂无评论...
验证码 换一张
取 消