热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

JqueryUI滑块,设置值bug-JqueryUIslider,settingvaluesbug

ihave3divs我有3个div<div><div><divid

i have 3 div's

我有3个div

i have added the slider to these div's using class reference

我已经使用类引用将滑块添加到这些div中

$(function() {
        $(".slider-range").slider({
            range: true,
            min: 0,
            max: 100,
            slide: function(event, ui) {

            }
        });
});

the ranges of each sliders are different. I want to add that dynamically

每个滑块的范围是不同的。我想动态添加它

I tried

$("#slider-range1").slider('option','values',[1, 100]);

but it is not working :(

但它不起作用:(

2 个解决方案

#1


5  

have you tried:

你有没有尝试过:

$('selector').slider( 'values' , index , value ); // index would be the square in the slider

in your example you could:

在你的例子中你可以:

$("#slider-range1").slider('values', 0, 50);
$("#slider-range1").slider('values', 1, 100);

#2


1  

$('#slider-range').slider('option', 'min', 1);

$('#slider-range')。slider('option','min',1);

$('#slider-range').slider('option', 'max', 100);

$('#slider-range')。slider('option','max',100);

Updated according to poster's comment on this answer:

根据海报对此答案的评论更新:

Actually, your question contains an naswer :)

实际上,你的问题包含了一个问题:)

http://jqueryui.com/demos/slider/#option-range

$("#slider-range").slider({
    range: true,
    min: 0,
    max: 500,
    values: [75, 300],
});

推荐阅读
author-avatar
yoyokk99的秋天
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有