【求教】uncaught typeerror cannot read property
jquery吧
全部回复
仅看楼主
level 1
页面中有个JQ的轮播图动画,然后出问题的是底部的浮动横幅广告,不能从侧边缩进
查看控制台说获取不了这个css元素;是不是冲突问题,因为横幅广告独立拿出来测试是正常的
代码如下
<div class="bottom_bar" style="z-index:999;">
<div class="bottom_bar2" ><a href="javascript:" class="bar"></a>
<ul>
<li ><a href="#" target="_blank"><img src="./wang.png" alt="" /></a></li>
</ul>
</div>
</div>
<script type="text/javascript" src="./jquery-1.7.2.min.js"></script>
<style type="text/css">
.bottom_bar{ width:260px; height:200px; position:fixed; bottom: -35px; left: 0px;}
.bottom_bar2{ width:240px; height:180px; position:relative;}
.bottom_bar2 ul li{ width:100%; height:22px; }
.bar{ width:45px; height:45px; position:absolute; right:-950px; top:32px;display:block;}
</style>
<script>
$(function(){
$('.bottom_bar').css('left','-1450px');
var expanded = true;
$('.bottom_bar').animate({left:'0'},500);
$('.bar').css('background-position','-25px 0px');
expanded = !expanded;
$('.bar').click(function(){
if (expanded) {
$('.bottom_bar').animate({left:'0'},500);
$('.bar').css('background-position','-25px 0px');
}else {
$('.bottom_bar').animate({left:'-1450px'},500);
$('.bar').css('background-position','-0px 0px');
}
expanded = !expanded;
});
});
var j = jQuery.noConflict(true);
</script>
<!-- 结束 -->
2015年10月14日 00点10分 1
1