javascript jquery 表单滑块(输入滑块)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8630069/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-26 04:02:51  来源:igfitidea点击:

jquery form slider (input-slider)

javascriptjqueryformsinputslider

提问by Ilya Medvedev

How to make slider with jquery, like here?

如何使用 jquery 制作滑块,就像这里一样?

sample

样本

User should select a value from slider, and this value should automatically be in input

用户应从滑块中选择一个值,该值应自动输入

I can not find the appropriate plug-in...

我找不到合适的插件...

回答by Shyju

http://jqueryui.com/demos/slider/

http://jqueryui.com/demos/slider/

 $( "#slider" ).slider({
        value:100,
        min: 0,
        max: 500,
        step: 50,
        slide: function( event, ui ) {
                           //Its setting the slider value to the element with id "amount"
            $( "#amount" ).val( "$" + ui.value );
        }
    });

You can customize the style to look like the example you mentioned.

您可以自定义样式以使其看起来像您提到的示例。