本文实例讲述了jquery使用fadein方法实现渐出效果的方法。分享给大家供大家参考。具体分析如下:
下面的js代码通过jquery的fadein方法控制指定色块逐渐显示的功能
<!doctype html> <html> <head> <script src="js/jquery.min.js"> </script> <script> $(document).ready(function(){ $("button").click(function(){ $("#p1").fadein(); $("#p2").fadein("slow"); $("#p3").fadein(3000); }); }); </script> </head> <body> <p>demonstrate fadein() with different parameters.</p> <button>click to fade in boxes</button> <br><br> <p id="p1" style="width:80px;height:80px;display:none;background-color:red;"> </p><br> <p id="p2" style="width:80px;height:80px;display:none;background-color:green;"> </p><br> <p id="p3" style="width:80px;height:80px;display:none;background-color:blue;"> </p> </body> </html>
如对本文有疑问, 点击进行留言回复!!
offset、client、scroll (width,height、left,top、X,Y)
网友评论