2

我已经在我的页面中实现了一个 twitter 引导轮播,但遇到了问题。它将浏览我添加到其中的三个图像,但是在加载最后一个图像而不是循环回到第一个图像之后,它似乎在轮播中创建并清空项目,并暂停几秒钟,然后返回到第一个图片。使用“左”箭头时它可以正确滚动,但使用“右”箭头时会添加一个空图像。任何帮助,将不胜感激。我已经在我的 .js 文件中初始化了轮播。

<div id="myCarousel" class="carousel slide">        
  <div class="carousel-inner">            
  <!-- Carousel items -->            
  <div class="active item" style="background: none repeat scroll 0% 0% #000000">
    <img width="1700" height="500" alt="" src="/cmsimages/0/globe---Copy.png" style="margin: auto" />
  </div>

  <!--2nd carousel item-->            
  <div class="item" style="background: none repeat scroll 0% 0% #000000">
    <img width="1716" height="530" alt="" src="/cmsimages/0/devwordcloud.jpg" />
  </div>

  <div class="item" style="background: none repeat scroll 0% 0% #000000">
    <img width="1716" height="530" alt="" src="/cmsimages/0/Clouds.png" />   
  </div>            
  <!-- Carousel nav -->
  <a data-slide="prev" href="#myCarousel" class="left carousel-control">‹&lt;/a>
  <a data-slide="next" href="#myCarousel" class="right carousel-control">›&lt;/a>
  <!-- End Carousel --> 
  </div>
</div>          
4

1 回答 1

5

在编辑您发布的代码并更清楚地看到它之后,我能够看到您在 carousel-inner 块中包含了 carousel nav,它应该在它之外。

<div id="myCarousel" class="carousel slide">        
  <div class="carousel-inner">            
    <!-- Carousel items -->            
    <div class="active item" style="background: none repeat scroll 0% 0% #000000">
      <img width="1700" height="500" alt="" src="/cmsimages/0/globe---Copy.png" style="margin: auto" />
   </div>

    <!--2nd carousel item-->            
    <div class="item" style="background: none repeat scroll 0% 0% #000000">
      <img width="1716" height="530" alt="" src="/cmsimages/0/devwordcloud.jpg" />
    </div>

    <div class="item" style="background: none repeat scroll 0% 0% #000000">
      <img width="1716" height="530" alt="" src="/cmsimages/0/Clouds.png" />   
    </div>
  </div> <!-- / carousel-inner -->

  <!-- Carousel nav -->
  <a data-slide="prev" href="#myCarousel" class="left carousel-control">‹&lt;/a>
  <a data-slide="next" href="#myCarousel" class="right carousel-control">›&lt;/a>
  <!-- End Carousel --> 
</div>          
于 2012-11-27T22:32:21.613 回答