jQuery UI 下载
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery UI 滑块(Slider) - 颜色选择器</title>
<link rel="stylesheet" href="jquery-ui.min.css">
<script src="jquery.js"></script>
<script src="jquery-ui.min.js"></script>
<style>
#box {
width: 1200px;
margin: 0 auto;
}
.box-p {
display: flex;
justify-content: center;
}
#red {
float: left;
clear: left;
width: 1200px;
margin: 15px auto;
}
#red .ui-slider-range {
background: #ef2929;
}
#red .ui-slider-handle {
border-color: #ef2929;
}
</style>
<script>
function refreshSwatch(event, ui) {
$("#amount").val("$" + ui.value);
var red = $("#red").slider("value");
}
$(function() {
$("#red").slider({
orientation: "horizontal",
range: "min",
min: 1000,
max: 20000,
value: 5000,
change: refreshSwatch,
slide: refreshSwatch
});
$("#red").slider("value", 5000);
});
</script>
</head>
<body>
<div id="box">
<p class="box-p">
<label for="amount">贷款金额($1 增量):</label>
<input type="text" id="amount" style="border:0; color:#f6931f; font-weight:bold;">
</p>
<div id="red"></div>
</div>
</body>
</html>
网友评论