我想在一页上循环播放四个幻灯片。它们非常简单,基于Jon Raasch 的简单 JQuery 幻灯片。
我很擅长标记和 CSS,但对 javascript 还不是很精通。现在,我可以制作一张幻灯片,但不能同时制作四张。我希望得到一些帮助,让这四个人都能工作。谢谢!
JS:
<script type="text/javascript" src="js/jquery.bxslider.min.js"></script>
<script type="text/javascript">
$('#slider1').bxSlider({
auto: true,
autoControls: true,
pause: 3000,
slideMargin: 20
});
$('#slider2').bxSlider({
auto: true,
autoControls: true,
pause: 3000,
slideMargin: 20
});
$('#slider3').bxSlider({
auto: true,
autoControls: true,
pause: 3000,
slideMargin: 20
});
$('#slider4').bxSlider({
auto: true,
autoControls: true,
pause: 3000,
slideMargin: 20
});
</script>
CSS:
.slider {
position: relative;
float: right;
padding-right: 400px;
margin-left: 40px;
height: 350px;
}
.slider img {
position: absolute;
max-width: 350px;
height: auto;
-webkit-border-radius: 20px;
-moz-border-radius: 20px;
border-radius: 20px;
top: 0;
left: 0;
z-index: 8;
}
加价:
<div>
<div class="slider">
<ul id="slider1">
<li><img src="images/.../art-1.jpg" /></li>
<li><img src="images/.../art-2.jpg" /></li>
<li><img src="images/.../art-3.jpg" /></li>
<li><img src="images/.../art-4.jpg" /></li>
<li><img src="images/.../art-5.jpg" /></li>
</ul>
</div>
</div>
<div>
<div class="slider">
<ul id="slider2">
<li><img src="images/.../bnl-1.jpg" /></li>
<li><img src="images/.../bnl-2.jpg" /></li>
<li><img src="images/.../bnl-3.jpg" /></li>
<li><img src="images/.../bnl-4.jpg" /></li>
<li><img src="images/.../bnl-5.jpg" /></li>
</ul>
</div>
</div>
<div>
<div class="slider">
<ul id="slider3">
<li><img src="images/.../bge-1.jpg" /></li>
<li><img src="images/.../bge-2.jpg" /></li>
<li><img src="images/.../bge-3.jpg" /></li>
<li><img src="images/.../bge-4.jpg" /></li>
<li><img src="images/.../bge-5.jpg" /></li>
</ul>
</div>
</div>
<div>
<div class="slider">
<ul id="slider4">
<li><img src="images/.../rtb-1.jpg" /></li>
<li><img src="images/.../rtb-2.jpg" /></li>
<li><img src="images/.../rtb-3.jpg" /></li>
<li><img src="images/.../rtb-4.jpg" /></li>
<li><img src="images/.../rtb-5.jpg" /></li>
</ul>
</div>
</div>