本文实例讲述了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中hide和fadeOut的区别 show和fadeIn的区别
- jQuery动画效果-fadeIn fadeOut淡入浅出示例代码
- jQuery中fadeIn、fadeOut、fadeTo的使用方法(图片显示与隐藏)
- js模拟jquery的slide和fadeIn和fadeOut功能
- jquery实现翻动fadeIn显示的方法
- 在IE 浏览器中使用 jquery的fadeIn() 效果 英文字符字体加粗
- jquery 图片Silhouette Fadeins渐显效果
- jQuery中fadein与fadeout方法用法示例