如何填充圆形范围滑块内的背景颜色?以及如何增加工具提示的字体大小?
How to fill the background color inside of the circular range slider?And also how to increase the font size of the tooltip?
这是我的代码:
HTML:
<div id="slider"></div>
CSS:
body{
background: black;}[enter image description here][1]
<script>
$("#slider").roundSlider({
radius: 180,
min: 10,
max: 30,
circleShape: "pie",
sliderType: "min-range",
value: 50,
editableTooltip: false,
startAngle: 315,
tooltipFormat: "changeTooltip",
});
window.updateBox = function (e) {
var profit = Math.round(this.options.value * 0.005);
}
window.changeTooltip = function (e) {
updateBox.call(this);
return e.value + "°C" ;
}
</script>
我好像无法在曲线内部填充颜色。谁能帮我解决这个问题?提前致谢!
PS : 您正在使用 roundSlider 插件而不是 uiSlider。
因此,根据文档,您可以通过为其分配一个 id(在您的示例中为“slider”)来修改您的元素。
$("#slider").roundSlider({
radius: 80,
width: 14,
svgMode: true
handleSize: "+8",
handleShape: "dot",
sliderType: "min-range",
value: 40
});
在您的 CSS 文件中,您可以添加所需的样式:
#slider .rs-range-color {
background-color: #ff0000;
}
#slider .rs-handle:after {
background-color: #000000;
}
#slider .rs-border {
border-color: #ff0000;
}
#slider .rs-tooltip-text {
font-size: 18px;
}
在 roundSlider you have the svgMode 中解决了这个问题。
window.updateBox = function (e) {
var profit = Math.round(this.options.value * 0.005);
}
window.changeTooltip = function (e) {
updateBox.call(this);
return e.value + "°C" ;
}
$("#slider").roundSlider({
radius: 180,
min: 10,
max: 30,
circleShape: "pie",
sliderType: "min-range",
value: 20,
editableTooltip: false,
startAngle: 315,
tooltipFormat: "changeTooltip",
svgMode: true,
rangeColor: "#03a9f4",
pathColor: "#eee",
borderColor: "black",
lineCap: "round"
});
这是我的代码: HTML:
<div id="slider"></div>
CSS:
body{
background: black;}[enter image description here][1]
<script>
$("#slider").roundSlider({
radius: 180,
min: 10,
max: 30,
circleShape: "pie",
sliderType: "min-range",
value: 50,
editableTooltip: false,
startAngle: 315,
tooltipFormat: "changeTooltip",
});
window.updateBox = function (e) {
var profit = Math.round(this.options.value * 0.005);
}
window.changeTooltip = function (e) {
updateBox.call(this);
return e.value + "°C" ;
}
</script>
我好像无法在曲线内部填充颜色。谁能帮我解决这个问题?提前致谢!
PS : 您正在使用 roundSlider 插件而不是 uiSlider。
因此,根据文档,您可以通过为其分配一个 id(在您的示例中为“slider”)来修改您的元素。
$("#slider").roundSlider({
radius: 80,
width: 14,
svgMode: true
handleSize: "+8",
handleShape: "dot",
sliderType: "min-range",
value: 40
});
在您的 CSS 文件中,您可以添加所需的样式:
#slider .rs-range-color {
background-color: #ff0000;
}
#slider .rs-handle:after {
background-color: #000000;
}
#slider .rs-border {
border-color: #ff0000;
}
#slider .rs-tooltip-text {
font-size: 18px;
}
在 roundSlider you have the svgMode 中解决了这个问题。
window.updateBox = function (e) {
var profit = Math.round(this.options.value * 0.005);
}
window.changeTooltip = function (e) {
updateBox.call(this);
return e.value + "°C" ;
}
$("#slider").roundSlider({
radius: 180,
min: 10,
max: 30,
circleShape: "pie",
sliderType: "min-range",
value: 20,
editableTooltip: false,
startAngle: 315,
tooltipFormat: "changeTooltip",
svgMode: true,
rangeColor: "#03a9f4",
pathColor: "#eee",
borderColor: "black",
lineCap: "round"
});