jQuery使用fadein方法实现渐出效果实例
本文实例讲述了jQuery使用fadein方法实现渐出效果的方法。分享给大家供大家参考。具体分析如下:
下面的JS代码通过jQuery的fadein方法控制指定色块逐渐显示的功能
<!DOCTYPEhtml>
<html>
<head>
<scriptsrc="js/jquery.min.js">
</script>
<script>
$(document).ready(function(){
$("button").click(function(){
$("#div1").fadeIn();
$("#div2").fadeIn("slow");
$("#div3").fadeIn(3000);
});
});
</script>
</head>
<body>
<p>DemonstratefadeIn()withdifferentparameters.</p>
<button>Clicktofadeinboxes</button>
<br><br>
<divid="div1"
style="width:80px;height:80px;display:none;background-color:red;">
</div><br>
<divid="div2"
style="width:80px;height:80px;display:none;background-color:green;">
</div><br>
<divid="div3"
style="width:80px;height:80px;display:none;background-color:blue;">
</div>
</body>
</html>
希望本文所述对大家的jQuery程序设计有所帮助。
热门推荐
10 毕业离别祝福语简短老师
11 新年英文祝福语简短老师
12 鼓励弟弟高考祝福语简短
13 北影考生祝福语简短英语
14 中考正能量祝福语简短
15 男友红包祝福语简短精辟
16 给司机老师祝福语简短
17 撩妹生日祝福语简短
18 妈妈生日祝福语简短温暖