将以下代码加到需要的模板即可,在页面两侧均可显示广告位置,漂浮

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>  
<script type="text/javascript">  
$(document).ready(function(){  
 var duilian = $("div.duilian");  
 var duilian_close = $("a.duilian_close");  
     
 var screen_w = screen.width;  
 if(screen_w>1024){duilian.show();}  
 $(window).scroll(function(){  
  var scrollTop = $(window).scrollTop();  
  duilian.stop().animate({top:scrollTop+260});  
 });  
 duilian_close.click(function(){  
  $(this).parent().hide();  
  return false;  
 });  
     
     
});  
</script>  
<style>  
/*下面是对联广告的css代码*/
.duilian{top:260px;position:absolute; width:102px; overflow:hidden; display:none;}  
.duilian_left{ left:6px;}  
.duilian_right{right:6px;}  
.duilian_con{border:#CCC solid 1px; width:100px; height:300px; overflow:hidden;}  
.duilian_close{ width:100%; height:24px; line-height:24px; text-align:center; display:block; font-size:13px; color:#555555; text-decoration:none;}  
</style>  
    
    
<!--下面是对联广告的html代码结构-->  
<div class="duilian duilian_left">  
 <div class="duilian_con">对联的内容</div>  
    <a href="#" class="duilian_close">X关闭</a>  
</div>  
<div class="duilian duilian_right">  
 <div class="duilian_con">对联的内容</div>  
    <a href="#" class="duilian_close">X关闭</a>  
</div>
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。