0
JS什么有趣的问题与动画jQuery的
<div id="new-products" class="clear-fix">
<button id="scroll-left"></button>
<div id="pics-scroll">
<img src="upload/upd_img_1.png" alt="Обувь">
<img src="upload/upd_img_2.png" alt="Обувь">
<img src="upload/upd_img_3.png" alt="Обувь">
<img src="upload/upd_img_1.png" alt="Обувь">
</div>
<button id="scroll-right"></button>
</div>
我的CSS是在这里(什么有趣太):
#new-products{
height: 169px;
position: relative;
padding: 5px 0 5px 0;
background: #f2f2f2;
}
#new-products img {
float: left;
height: 169px;
width: 170px;
background: #ffffff;
width: 170px;
height: 169px;
margin: 0 20px 0 0;
}
#pics-scroll{
position: absolute;
width: 1000px;
height: 169px;
margin-left:85px;
}
#scroll-left{
float: left;
position: absolute;
cursor: pointer;
margin: 50px 5px 0 13px;
width: 54px;
height: 70px;
display: block;
background: url('../images/scroll-left.png')center no-repeat;
}
#scroll-right{
cursor: pointer;
margin-left: 840px;
position: absolute;
margin-top: 50px;
width: 54px;
height: 70px;
display: block;
background: url('../images/scroll-right.png')center no-repeat;
}
的主要问题是:反正它不动。
我不知道,为什么它不起作用。我怎样才能使它工作。
jQuery代码是错误的。你需要将它包装在函数中,该函数将在加载或准备就绪时触发,如$(document).ready(function(){...}); – UtherTG