首页 > 代码库 > jq slider()
jq slider()
$(function(){
function scaleImage(){
console.log(‘aa‘);
var sliderValue=http://www.mamicode.com/$(".scale").slider("value");
$(".aa").text(sliderValue)
$(".img").css("width",sliderValue)
}
var sliderOptions={
animate: "true",
min: 100,
max:200,
step:1,
value:175,
slider:scaleImage,
change:scaleImage
}
$(document).ready(function(){
$(".scale").slider(sliderOptions)
})
})
</script>
<style type="text/css">
.scale{width: 250px;background: #F3F3F3;}
.img{width: 175px;height: 100px;}
</style>
</style>
</head>
<body>
<div class="scale">
</div>
<div class="aa">
175
</div>
<div id="bb">
<img class="img" src="http://www.mamicode.com/notes.png"/>
</div>
</body>
jq slider()