我想在图片中设置我的 roundSlider 的样式:
我已经浏览了圆形滑块https://roundsliderui.com/document.html的文档,但由于我对 CSS 的了解有限,我无法像上图那样设置它的样式。
这是我到目前为止的代码:
HTML:
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title></title>
</head>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/jquery.roundslider/1.0/roundslider.min.css">
<body>
<div class="container">
<div id="thermostatSlider"></div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js" charset="utf-8">
</body>
CSS:
.rs-range-color {
background-color: #33B5E5;
}
.rs-path-color {
background-color: #C2E9F7;
}
.rs-handle {
background-color: #C2E9F7;
padding: 7px;
border: 2px solid #C2E9F7;
}
.rs-handle.rs-focus {
border-color: #33B5E5;
}
.rs-handle:after {
border-color: #33B5E5;
background-color: #33B5E5;
}
.rs-border {
border-color: transparent;
}
.rs-tooltip-text {
font-family: Roboto, sans-serif;
font-size: 30px;
border-radius: 7px;
transition: background 0.02s ease-in-out;
color: #33B5E5;
}
.rs-tooltip-text:before {
position: absolute;
left: 3px;
top: -15px;
content: 'COOLING';
font-size: 12px;
}
.rs-tooltip-text:after {
position: absolute;
left: 19px;
top: 48px;
content: '19';
font-size: 12px;
}
.container{
position: absolute;
z-index: 2;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-family: Roboto, sans-serif;
}
JS:
$("#thermostatSlider").roundSlider({
radius: 80,
width: 8,
min: 15,
max: 75,
handleSize: "+16",
circleShape: "pie",
handleShape: "dot",
sliderType: "min-range",
startAngle: 315,
value: 24,
disabled: false
});
另外,我的问题是我无法将其设置为在放入 boostrap 卡时正常运行。最重要的是指出,如下所示:https ://ibb.co/26xCBrp 。
我还用上面的代码准备了一个小 jsfiddle:JSFiddle。