jquery实现对联广告代码

ASP 1727 0 2014-03-14

jquery实现对联广告代码

HTML:
<div class="dls"><div class="duilian duilian_left">左对联</div><div class="duilian duilian_right">右对联</div></div>

 

CSS:

.dls{ width:1330px; margin:auto; position:relative}
.duilian{top:0px;position:absolute; width:170px; overflow:hidden; z-index:20}
.duilian_left{ margin-left:0px;} .duilian_right{margin-left:1160px;}

 

JS:
<script type="text/javascript">
$(document).ready(function(){
var duilian = $("div.duilian"); duilian.animate({top:269},1000);
$(window).resize(function(){var window_w = $(window).width(); if(window_w>1320){duilian.show();}else{duilian.hide();}});
$(window).scroll(function(){ var scrollTop = $(window).scrollTop(); duilian.stop().animate({top:scrollTop+269},1000); });
});
</script>

上一篇:asp多表联合查询总结

下一篇:ASP判断是手机还是电脑PC访问网站

讨论数量:0

请先登录再发表讨论。 2024-11-24

天涯网魂
3 杠 5 星
TA 的文章
TA 的随言
TA 的资源链