导航栏无法正常工作(bootstrap v3)

时间:2013-09-20 02:15:01

标签: javascript jquery html css twitter-bootstrap

我的导航栏表现不正常。它同时在垂直行中显示3个滑块图像,并且不会滑过图片。使用的CSS是twitter bootstrap。我有自己的CSS,但没有影响轮播,也没有添加javascript,只有Jquery和bootstrap.js。这是bootstrap V3。任何的想法?

<div class="container">
   <div id="carousel-example-generic" class="carousel slide">
      <ol class="carousel-indicators">
         <li data-target="#carousel-example-generic" data-   
            slide-to="0" class="active"></li>
         <li data-target="#carousel-example-generic" data-
            slide-to="1"></li>
         <li data-target="#carousel-example-generic" data-
            slide-to="2"></li>
      </ol>
      <div class="carousel-inner">
         <div class="item active">
            <img src="img/timthumb.jpg" alt="...">
            <div class="carousel-caption">
               <p>Eyes of the owl</p>
            </div>
         </div>
         <div class="item active">
            <img src="img/timthumb.jpg" alt="...">
            <div class="carousel-caption">
               <p>Eyes of the owl</p>
            </div>
         </div>
         <div class="item active">
            <img src="img/timthumb.jpg" alt="...">
            <div class="carousel-caption">
               <p>Eyes of the owl</p>
            </div>
         </div>
      </div>
      <!-- Controls -->
      <a class="left carousel-control" href="#carousel-
         example-generic" data-slide="prev">
      <span class="icon-prev"></span>
      </a>
      <a class="right carousel-control" href="#carousel-
         example-generic" data-slide="next">
      <span class="icon-next"></span>
      </a>
   </div>
</div>

1 个答案:

答案 0 :(得分:2)

您的问题似乎是您已为所有幻灯片指定了active课程。 仅为第一个开头指定。为所有这些指定active会使所有这些都可见并且其选择器会切换幻灯片(不是活动项目是上一个或下一个点击按钮无法获取其他任何内容)无法选择,因为没有任何非活动状态可用。

            <div class="item active">
                <img src="http:\\placehold.it\32x100" alt="..." />
                <div class="carousel-caption">
                    <p>Eyes of the owl</p>
                </div>
            </div>
            <div class="item"> <!-- removed active class from here -->
                <img src="http:\\placehold.it\42x100" alt="..." />
                <div class="carousel-caption">
                    <p>Eyes of the owl</p>
                </div>
            </div>
            <div class="item"><!-- removed active class from here -->
                <img src="http:\\placehold.it\52x100" alt="..." />
                <div class="carousel-caption">
                    <p>Eyes of the owl</p>
                </div>
            </div>

<强> Fiddle