2015-07-01 126 views
2

嘿,我想在頁面上實現傳送帶。但我面臨的問題是隻有活動圖像顯示在屏幕上。圖像甚至沒有移動,即第二個和第三個圖像不顯示,儘管文件夾中存在beign。 我把圖像放在我的index.html文件所在的同一個文件夾中。 請幫忙。我的代碼片段如下:Bootstrap:傳送帶圖像不移動

<!-- carousel here --> 
<div id="myCarousel" class="carousel slide"> 
    <!-- Indicators --> 
    <ol class="carousel-indicators"> 
    <li data-target="#myCarousel" data-slide-to = "0" class="active"></li> 
    <li data-target="#myCarousel" data-slide-to = "1"></li> 
    <li data-target="#myCarousel" data-slide-to = "2"></li> 
    </ol> 

    <!-- Wrapper for slides --> 
    <div class="carousel-inner"> 

    <div class="item active"> 
     <img src="slide_1.jpg" alt="Sale 1" class="img-responsive"> 
     <div class="carousel-caption"> 
     <!-- caption here --> 
     </div> 
    </div> 

    <div class="item"> 
     <img src="slide_2.jpg" alt="Sale 2" class="img-responsive"> 
     <div class="carousel-caption"> 
     <!-- caption here --> 
     </div> 
    </div> 

    </div> 

    <!-- Controls --> 
    <a class="carousel-control left" href="#myCarousel" data-slide="prev"> 
    <span class="icon-prev"></span> 
    </a> 

    <a class="carousel-control right" href="#myCarousel" role="button" data-slide="next"> 
    <span class="icon"></span> 
    </a> 

</div> 
<!-- div Carousel ends here --> 

回答

0

您是否在頭標中包含了以下腳本?

<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> 
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> 
    <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script> 
    <style> 
    .carousel-inner > .item > img, 
    .carousel-inner > .item > a > img { 
     width: 70%; 
     margin: auto; 
    } 
    </style> 
+0

感謝好友..它現在工作。 :d –