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

标签 javascript html css angularjs internet-explorer

所以我有一个空白页面,例如在 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/

相关文章:

javascript - 为什么JSON全部大写

javascript - 我的下拉菜单无法使用 Bootstrap

用于链接格式的 CSS 语法

javascript - 如何清除 Canvas ?

JavaScript 变量声明前后?

javascript - php-js 函数未定义

c# - 用户访问 img 文件

html - 悬停时显示图像的CSS代码

html - css列响应式设计

jquery - 如何修复 Bootstrap 中的侧面布局