此方法适合当当前位置大于屏幕高度时,层淡入淡出的效果
<script type="text/javascript" src=""></script>
<div class="ad" style="position:fixed; right:10px; bottom:20px; width:10px; height:80px; background-color:red;"></div><div style="height:2000px; background:#333; width:90%;"></div><script>$(window).bind(‘scroll’,function(){ $(this).scrollTop() > $(window).height() ? $(‘.ad’).fadeIn() : $(‘.ad’).fadeOut(); });</script>
,快乐要懂得分享,才能加倍的快乐