如何使 html5 滑块(输入类型='范围')在 Firefox 中工作

2022-01-24 00:00:00 range firefox browser html

我尝试使用html5元素,即

I try to use html5 element, which is

<input type='range' step='1' min='-300' max='-1' />

它应该是一个滑块.它适用于 Chrome.但它在 Firefox8 中不起作用.我在html5test.com"中检查过,它说 Firefox 8 部分支持范围"类型.它支持min"和max"属性,但不支持step"属性.然后我删除step"属性,比如

It is supposed to be a slider. It works in Chrome. But it does not work in Firefox8. I checked that in "html5test.com", it says firefox 8 partially supports the "range" type. It supports "min" and "max" attribute, but not "step" attribute. Then I erase the "step" attribute, like

<input type='range' min='-300' max='-1' />

为什么还是不行?

有什么办法让它工作吗?

Is any way to let it work?

推荐答案

这是 不支持 在版本 23 之前的 Firefox 中.有关版本 4 及更高版本中的 Javascript 实现,请参阅 http://frankyan.com/labs/html5slider/ .

This is not supported in Firefox before version 23. For a Javascript implementation in versions 4 and up, please see http://frankyan.com/labs/html5slider/ .

根据 Jonathan Watt 对上述错误报告的评论,支持已添加到 Firefox 开发分支并随版本 23 一起发布.

According to Jonathan Watt's comment on the bug report linked above, support has been added to the Firefox development branch and was released with version 23.

相关文章