1

我在一页上有四个幻灯片,我只想循环运行,使用bxSlider

我很擅长标记和 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>
4

0 回答 0