我想达到以下相同但水平。我尝试将方向更改为水平,甚至完全将其保留为水平,但默认为水平,但颜色默认为橙色。我正在使用ASP.NET。
答案 0 :(得分:0)
我觉得有点难以理解你想要什么100%
但我为你创建了水平。
$(function() {
$("#slider-vertical").slider({
orientation: "Horizontal",
range: "min",
min: 0,
max: 100,
value: 60,
slide: function(event, ui) {
$("#amount").val(ui.value);
var g = parseInt(ui.value <= 50 ? 255 : 255 - ((ui.value-50)*(255/50)));
var r = parseInt(ui.value >= 50 ? 255 : 255 - ((50-ui.value)*(255/50)));
$(".ui-widget-header").css("background-color", "rgb("+r+","+g+",0)");
}
});
$("#amount").val($("#slider-vertical").slider("value"));
});