gpt4 book ai didi

javascript - IE 阻止键盘滚动上的选择列表更改事件

转载 作者:可可西里 更新时间:2023-11-01 14:56:51 27 4
gpt4 key购买 nike

我在 IE 和 Chrome 的选择列表中遇到更改事件的问题。 When the option list is closed the change event in IE fires when scrolling through the list with the keyboard.在 Chrome 中,滚动时不会触发更改事件。

让 IE 像 Chrome 一样运行的最佳方式是什么?

http://jsfiddle.net/mTLrY/4/

<select>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
</select>

$('select').change(function(){
alert('changing');
});

最佳答案

尝试使用 onBlur 而不是 onchange。 onblur 用于当控件失去焦点时,这听起来像您可能真正想要的。我很确定 jquery 只是 $('select').blur(function(){....

关于javascript - IE 阻止键盘滚动上的选择列表更改事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6509572/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com