gpt4 book ai didi

javascript - 如何在 IE 中散焦下拉菜单? ( Angular )

转载 作者:行者123 更新时间:2023-11-28 00:27:37 25 4
gpt4 key购买 nike

所以我有一个空白页面,例如在 IE 中有一个选择选项下拉列表(经典)。我单击它更改值(或右键单击)以使其变为蓝色(聚焦)。

enter image description here
现在,如果您将鼠标悬停在它上面并开始滚动 => 您将看到该值正在发生变化。在 Chrome 中不会发生这种情况!

最佳答案

How to defocus dropdown in IE? (AngularJS) Now if you go with mouse over it and start to scroll => you will see that value is changing. In Chrome doesn't happened this!

根据您的描述,我认为您想防止使用滚动鼠标的方法来更改选定的值。如果是这样,你可以引用下面的代码在onmousewheel事件中返回false:

<select ng-model="selectedName" onmousewheel="return false;" ng-options="x for x in names">
</select>

关于javascript - 如何在 IE 中散焦下拉菜单? ( Angular ),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54569898/

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