$(function(){
function scaleImage(){
console.log('aa');
var sliderValue=$(".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="notes.png"/>
</div>
</body>
转载于:https://www.cnblogs.com/zuopin/p/5904523.html