Javascript HTML 滑块元素?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2838492/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
HTML Slider element?
提问by Claudiu
I'm coding an app (temporarily up here), and I want to make its parameters modifiable. I feel the best way to do this would be with your standard GUI slider elements (a la this, but not so ugly). I just noticed that the DOM doesn't provide these, however...
我正在编写一个应用程序(暂时在这里),我想让它的参数可以修改。我觉得最好的方法是使用您的标准 GUI 滑块元素(a la this,但不是那么难看)。我只是注意到 DOM 没有提供这些,但是......
What's the best way to introduce sliders to a webpage? Is there a standard library that everybody uses? Should I just roll my own? Or should is there a different element I can use? Should I embed them in the canvas element somehow?
将滑块引入网页的最佳方式是什么?是否有每个人都使用的标准库?我应该自己动手吗?或者应该有我可以使用的不同元素吗?我应该以某种方式将它们嵌入画布元素中吗?
采纳答案by MiffTheFox
jQuery UIdoes support this.
If you're already using jQuery, it would be easy to learn.
如果您已经在使用 jQuery,那将很容易学习。
回答by Ben Boyle
There is a slider control in HTML5, it's done with <input type="range" … />.
HTML5 中有一个滑块控件,它是通过 <input type="range" ... /> 完成的。
Check browser support here: http://caniuse.com/input-range
在此处检查浏览器支持:http: //caniuse.com/input-range
回答by jaywon
I'm sure there is probably a jQuery library for this as well, but this MooTools library is one that I have used before and had no complaints:
我确定可能还有一个 jQuery 库,但这个 MooTools 库是我以前使用过的,没有任何抱怨:
回答by Julio
I have used the one in YUI3. It is still in beta but it provides a lot of great features and skins. http://developer.yahoo.com/yui/3/slider/
我在 YUI3 中使用过一个。它仍处于测试阶段,但它提供了许多很棒的功能和皮肤。http://developer.yahoo.com/yui/3/slider/

