以下是需要引入的一些文件,如果没有您可以通过给定的地址进行下载,谢谢:
jquery-1.7.1.min.js http://jqueryui.com/
jquery-ui-1.8.18.custom.min.js http://jqueryui.com/download
jquery.ui.datepicker-zh-CN.js 该文件在下载好的第二个文件的该目录下: jquery-ui-1.8.18.custom\development-bundle\ui\i18n\
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style>
</style>
<title>jquery-ui-滑块</title>
<!--引入jquery类库文件 必须要有顺序-->
<script type="text/javascript" language="javascript" src="./js/jquery-1.7.1.min.js"></script>
<script type="text/javascript" language="javascript" src="./js/jquery-ui-1.8.18.custom.min.js"></script>
<!--css-->
<link type="text/css" rel="stylesheet" href="./css/ui-lightness/jquery-ui-1.8.18.custom.css" />
<script type="text/javascript">
$(function (){
$("#slider").slider({
disabled:false, //true不可用,false可用
animate:true, //动画效果
max:100, //滑块的最大值是100
min:-100, //滑块的最小值是0
//value:0, //默认值 0
values:[30,60], //多个默认值,有几个默认值就有几个滑块
orientation:"horizontal", //滑块的方向是垂直vertical的 还是水平的horizontal
range:true,
//stop:function (){
// alert("停止");
//}
// start:function (){
// alert("开始");
// }
});
});
</script>
</head>
<body>
<h2 class="demoHeaders">滑块的效果</h2>
<div id="slider"></div>
</body>
</html>