网站顶部自动伸缩隐藏广告

jQuery给web开发带来了极大的方便,网站顶部自动伸缩影藏广告是很多网站经常使用的技巧,主要利用jQuery的动画知识,使用了slideUP和slideDown两个函数。

jQuery部分的代码:

<script type="text/javascript">
$(document).ready(function(){
    
    $("#banner").slideDown("slow");    
})
 function displayimg(){
    $("#banner").slideUp(1000,function(){
        $("#top").slideDown(1000);
    })
  }
  setTimeout("displayimg()",2000);
</script>

HTML部分的代码
<div id="top" style="display:none;"><img src="02.jpg" width="980" height="60" /></div>
<div id="banner" style="width:980px; height:291px; display:none;"><img src="01.jpg" width="980" height="291" /></div>

 

posted @ 2013-12-13 11:28  Otgs  阅读(243)  评论(0编辑  收藏  举报