当前位置:主页 > jquery教程 > jQuery fadeTo方法调整图片的透明度使用介绍

jQuery fadeTo方法调整图片的透明度用法说明

发布:2020-06-22 08:24:11 83


给大家整理一篇相关的编程文章,网友慕含桃根据主题投稿了本篇教程内容,涉及到fadeTo、透明度、jQuery、jQuery fadeTo方法调整图片的透明度使用介绍相关内容,已被524网友关注,如果对知识点想更进一步了解可以在下方电子资料中获取。

jQuery fadeTo方法调整图片的透明度使用介绍

 

<head>
<title></title>
<style type="text/css">
.imgclass{ width:300px; height:300px; border:solid 1px red;}
</style>
<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>
</head>
<body>
<table>
<tr>
<td>
透明度:
<select id="Select1">
<option value="0">0</option>
<option value="0.2">0.2</option>
<option value="0.4">0.4</option>
<option value="0.6">0.6</option>
<option value="0.8">0.8</option>
<option value="1">1</option>
</select>
</td>
<td>
<img src="images/泪奔1.gif" class="imgclass" />
</td>
</tr>
</table>
</body>

参考资料

相关文章

网友讨论