javascript - Input type range with IE11 showing max/min integer
问题描述
When using an input type of range with a datalist in IE11, a value is shown on click. If the min/max happens to be greater than or less than the max integer (2,147,483,647), that value will be shown rather than the actual value.
Code:
<input type="range" value="0" min="-999999999999999999999" max="999999999999999999999" list="number" />
<datalist id="number">
<option>10</option>
<option>15</option>
<option>30</option>
<option>50</option>
<option>90</option>
</datalist>
I'd like to hide that box entirely, but can't seem to find the element to hide. Any thoughts? This only occurs in IE11.
解决方案
You need to set ms-tooltip to display: none in your CSS code to hide that value box.
Sample CSS:
input[type=range]::-ms-tooltip {
display: none;
}
Example:
<!doctype html>
<html>
<head>
<style>
input[type=range]::-ms-tooltip {
display: none;
}
</style>
</head>
<body>
<input type="range" value="0" min="-999999999999999999999" max="999999999999999999999" list="number" />
<datalist id="number">
<option>10</option>
<option>15</option>
<option>30</option>
<option>50</option>
<option>90</option>
</datalist>
</body>
</html>
Output in IE 11 browser:
推荐阅读
- python - 如何检查数据帧的第 i 行是否等于一个值?
- javascript - IMG 不断缩放滑块全屏
- sql - 使用 T-SQL 将非标准 mm:ss 转换为 hh:mm:ss
- tensorflow - 比较不同维度的张量
- python-3.x - 如何使用'or'在条件'if'中添加多个字符串?
- javascript - 我的 Slack 消息有效负载的 JSON 输出有什么问题?
- python - 如何从名称中获取图层的张量
- memcached - memcached “get” 在 telnet 中返回什么?
- javascript - Angular 反应形式的单选按钮值为空
- html - 如何在没有.html扩展名的情况下正确链接页面而不是具有相同名称的文件夹