我第一次玩输入类型=范围,理想情况下我想将步长值设置为值数组.我查看了规范,我看到了数据列表的可能性,但它接缝数据列表仅用于范围内的高亮值,可以这么说,但不设置范围内的值.
所以,这样的事情(理想情况下没有jQuery插件等):
<input type="range" min="1" max="100" value="0" step="1,3,5,10,20">
解决方法
根据
W3C spec,步骤的值可以是“任何”或正浮点数.而已.
The step attribute,if specified,must either have a value that is a valid floating-point number that parses to a number that is greater than zero,or must have a value that is an ASCII case-insensitive match for the string “any”.