本文实例讲述了jQuery使用fadein方法实现渐出效果的方法。分享给大家供大家参考。具体分析如下:
下面的JS代码通过jQuery的fadein方法控制指定色块逐渐显示的功能
<!DOCTYPE html>
<html>
<head>
<script src="js/jquery.min.js">
</script>
<script>
$(document).ready(function(){
$("button").click(function(){
$("#div1").fadeIn();
$("#div2").fadeIn("slow");
$("#div3").fadeIn(3000);
});
});
</script>
</head>
<body>
<p>Demonstrate fadeIn() with different parameters.</p>
<button>Click to fade in boxes</button>
<br><br>
<div id="div1"
style="width:80px;height:80px;display:none;background-color:red;">
</div><br>
<div id="div2"
style="width:80px;height:80px;display:none;background-color:green;">
</div><br>
<div id="div3"
style="width:80px;height:80px;display:none;background-color:blue;">
</div>
</body>
</html>
希望本文所述对大家的jQuery程序设计有所帮助。
最后
以上就是香蕉音响最近收集整理的关于jQuery使用fadein方法实现渐出效果实例的全部内容,更多相关jQuery使用fadein方法实现渐出效果实例内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复