jquery UI 滑块最小/最大值 [英] jquery UI slider min/max values

查看:43
本文介绍了jquery UI 滑块最小/最大值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以为 jquery ui 滑块和滚动显示数字时输入文本最小/最大值吗?这里 是一个例子,最大值的左侧滑块有无限制";当你滚动它时,会出现数字.

Can I put text min/max values for jquery ui slider and when scroll to appear digits? Here is an example, the left slider for max value has "no limit" and when you scroll it, appear digits.

推荐答案

您正在寻找范围滑块.我希望 范围滑块演示 有所帮助.可以在初始化滑块时设置最小值和最大值.

You are looking for the range slider. I hope the range slider demo helps. The min and max values can be set while initialising the slider.

已编辑很抱歉误解了这个问题.如果您查看 demo 的源代码,您会看到一个更改值的小脚本滑块值更改时元素#amount"的数量

Edited Sorry for misunderstanding the question. If you look at the source code of the demo you will see a small script that changes the values of element '#amount' when slider values are changed

这是脚本:

slide: function( event, ui ) {
            $( "#amount" ).val( "$" + ui.values[ 0 ] + " - $" + ui.values[ 1 ] );
        }

您可以更改它以显示字符值.

You can change this to display character values.

slide: function( event, ui ) {
            if (ui.values[0] == <min_value>) {
                 $( "#amount" ).val( "Min Limit" + " - $" + ui.values[ 1 ] );
            }
        }

您可以根据自己的要求修改此脚本

You can modify this script according to your requirements

注意:我没有对此进行测试.

这篇关于jquery UI 滑块最小/最大值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆