jQuery的fadeTo方法調整圖片的透明度

.imgclass{ width:300px; height:300px; border:solid 1px red;}

<script src=”jquery-1.9.1.js” type=”text/javascript”></script>
<script type=”text/javascript”>
$(function () {
$(‘#Select1’).change(function () {
var thevalue = $(this).val();
$(‘img’).fadeTo(2000, thevalue);
})
})
</script>

透明度:

0
0.2
0.4
0.6
0.8
1

You May Also Like