摘要:代码如下:<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>

小宝典致力于为广大程序猿(媛)提供高品质的代码服务,请大家多多光顾小站,小宝典在此谢过。

代码如下:

<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>

代码如下:

<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>

觉得可用,就经常来吧!Javascript技巧 脚本宝典 欢迎评论哦! js技巧,巧夺天工,精雕玉琢。小宝典献丑了!

本文固定链接: http://www.js-code.com/js/js_1580.html