答案 0 :(得分:4)
设置临时变量并将其与滑块的当前值进行比较。
<强> jsFiddle example 强>
var last = 0;
$(".slider").slider({
range: "min",
value: 1,
min: 1,
max: 600,
slide: function(event, ui) {
if (ui.value > last) $("#amount").val("this is increasing");
if (ui.value < last) $("#amount").val("this is decreasing");
last = ui.value;
}
});