滚动鼠标更改我的 select 元素的值

Scroll the mouse changes the value of my select element

我在某些浏览器中遇到鼠标滚动问题,如果用户在我的网站内上下移动会影响选择我拥有的多个值。这在所有浏览器中都会发生,我认为有一种方法可以通过 javascript 取消事件或取消值已更改。

您应该在 select 上触发 blur 事件:

$('select').on('change', function() {
    $(this).blur();


    // OR
    $(this).trigger('blur');
});

文档:https://api.jquery.com/blur/