Step parameter for input type of range

后端 未结 3 1914
甜味超标
甜味超标 2021-02-12 10:35

Is it possible to specify a decimal for a step parameter within the range element? According to a few articles I\'ve read, including one on Nettuts, this should be possible. Thi

相关标签:
3条回答
  • 2021-02-12 11:17

    The following works for me in chrome, I'm thinking that it's the shortcut step=".25" that won't work

     <input id="something" type="range" min="0" max="0" step ="0.25" value="5" />
    
    0 讨论(0)
  • 2021-02-12 11:32

    http://jsfiddle.net/Df57B/

    Check out this demo it is possible to give steps in decimal.

    <input type="range" name="points" min="1" max="10" 
           step="0.25" onchange="alert(this.value)"/>
    

    Your mistake take is that you gave .25 instead of 0.25.

    0 讨论(0)
  • 2021-02-12 11:38

    If you want to make it work in Firefox 4+, you can use the following: HTML5Slider

    0 讨论(0)
提交回复
热议问题