DIV CSS 佈局教程網

jQuery寫fadeTo示例代碼
編輯:JQuery特效代碼     
. 代碼如下:
<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 () {
$('#Button1').bind('click', function () {
$('img').fadeOut(2000, function () {
$('#Button1').val('哎,沒了');
});
})
$('#Button2').bind('click', function () {
$('img').fadeIn(2000, function () {
$('#Button2').val('有了');
});
})
$('#Button3').bind('click', function () {
$('img').fadeTo(2000, 0.3, function () {
alert('動畫執行完畢');
});
})
})
</script>
</head>
<body>
<div>
<div>
<input id="Button1" type="button" value="淡出" /><input id="Button2" type="button" value="淡入" /><input id="Button3" type="button" value="指定透明度" /></div>
<div><img src="images/1.jpg" class="imgclass"/></div>
</div>
</body>
XML學習教程| jQuery入門知識| AJAX入門| Dreamweaver教程| Fireworks入門知識| SEO技巧| SEO優化集錦|
Copyright © DIV+CSS佈局教程網 All Rights Reserved