下载jQuery UI:https://jqueryui.com/https://jqueryui.com/
jQuery UI中文网:Jquery UI 中文网https://www.jqueryui.org.cn/
1、下载后引入
<link rel="stylesheet" type="text/css" href="./css/jquery-ui.css" />
<script type="text/javascript" src="./js/jquery-ui.js"></script>
2、确定id,并将class写成volume-player
<div id="gainValue" class="volume-player"></div>
3、调用slider方法渲染
$("#gainValue").slider({
range: "min",
min: 0,
max: 100,
value: 50,
slide: function (event, ui) {
// 滑动触发
},
change: function (event, ui) {
// change事件
},
...
});