0

http://oi42.tinypic.com/2myduur.jpg

我有滑块:“数量”、“单价”、“折扣”

如果我滑动数量(数量有值 X),我需要更改滑块“单价”值 = X+5。

$(".quantity_{/literal}{$value['idProduct']}{literal}").empty().slider({
orientation: "vertical",
range: "min",
min: 0,
max: 100,
value: 0,
slide: function(event, ui)
{
$("#quantity_{/literal}{$value['idProduct']}{literal}").val(ui.value);
}
}).bind('slide slidechange', function(event,ui) {
/* Here is the problem, Here i can set value on slider change for input fields and other, but for slider I cant */ });
4

2 回答 2

2

试试这个代码

 $(".selector").slider("value", parseInt(ui.value)+5);
于 2013-08-23T11:26:44.100 回答
0

来自文档的您好:http: //api.jqueryui.com/slider/#option-value

$(".selector").slider("option", "value", 10);

代码示例:http: //jsfiddle.net/kdPZt/3/

于 2013-08-23T10:59:11.157 回答