2016-11-29 35 views
0

它的使用引導旋轉木馬我第一次所有的幻燈片,我沒有確切的文件說什麼,我都四張幻燈片顯示在彼此的頂部。任何提示?引導旋轉木馬是表示一次

  <div id="madinah-carousel" class="carousel slide" data-ride="carousel"> 
      <!-- Indicators --> 
      <ol class="carousel-indicators"> 
       <li data-target="#madinah-carousel" data-slide-to="0" class="active"></li> 
       <li data-target="#madinah-carousel" data-slide-to="1"></li> 
       <li data-target="#madinah-carousel" data-slide-to="2"></li> 
       <li data-target="#madinah-carousel" data-slide-to="3"></li> 
      </ol> 
      <!-- Wrapper for slides --> 
      <div class="carousel-inner" role="listbox"> 
       <div class="carousel-item active"> 
        <img src="img/mad/1.jpeg" alt="Madinah first screenshot"> 
       </div> 
       <div class="carousel-item"> 
        <img src="img/mad/2.jpeg" alt="Madinah second screenshot"> 
       </div> 
       <div class="carousel-item"> 
        <img src="img/mad/3.jpeg" alt="Madinah third screenshot"> 
       </div> 
       <div class="carousel-item"> 
        <img src="img/mad/4.jpeg" alt="Madinah fourth screenshot"> 
       </div> 
      </div> 
      <!-- Controls --> 
      <a class="left carousel-control" href="#madinah-carousel" role="button" data-slide="prev"> 
       <span class="icon-prev" aria-hidden="true"></span> 
       <span class="sr-only">Previous</span> 
      </a> 
      <a class="right carousel-control" href="#madinah-carousel" role="button" data-slide="next"> 
       <span class="icon-next" aria-hidden="true"></span> 
       <span class="sr-only">Next</span> 
      </a> 
     </div> 

我還包括這個JS功能:

$(function(){ 
$('.carousel').carousel() 
}); 

這是標頭:

<head> 
<meta charset="utf-8"> 
<meta http-equiv="X-UA-Compatible" content="IE=edge"> 
<meta name="viewport" content="width=device-width, initial-scale=1"> 
<!--- Font Awsome --> 
<script src="https://use.fontawesome.com/4c7009c904.js"></script> 
<!-- Latest compiled and minified CSS --> 
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> 
<!-- my CSS --> 
<link rel="stylesheet" href="css/styles.css"> 

在的底部我有以下:

 <!-- jQuery (necessary for Bootstrap's JavaScript plugins) --> 
    <script src="https://code.jquery.com/jquery-3.1.1.slim.js" integrity="sha256-5i/mQ300M779N2OVDrl16lbohwXNUdzL/R2aVUXyXWA=" crossorigin="anonymous"></script> 
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> 
    <!-- Latest compiled and minified JavaScript --> 
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script> 
    <!-- Scrolling Nav JavaScript --> 
    <script src="js/jquery.easing.min.js"></script> 
    <script src="js/scrolling-nav.js"></script> 
    <script src="js/script.js"></script> 
+0

您會顯示文件的標題嗎?應該有參考。 –

+0

當你調用該函數?這些元素當時是否已經存在? – CBroe

+0

檢查所裝載的引導,你有缺課,我認爲。 –

回答

3

你在div 設置好的錯誤類這不是DIV CLASS =「旋轉木馬項目」它只是DIV CLASS =「項」

<div id="madinah-carousel" class="carousel slide" data-ride="carousel"> 
      <!-- Indicators --> 
      <ol class="carousel-indicators"> 
       <li data-target="#madinah-carousel" data-slide-to="0" class="active"></li> 
       <li data-target="#madinah-carousel" data-slide-to="1"></li> 
       <li data-target="#madinah-carousel" data-slide-to="2"></li> 
       <li data-target="#madinah-carousel" data-slide-to="3"></li> 
      </ol> 
      <!-- Wrapper for slides --> 
      <div class="carousel-inner" role="listbox"> 
       <div class="item active"> 
        <img src="img/mad/1.jpeg" alt="Madinah first screenshot"> 
       </div> 
       <div class="item"> 
        <img src="img/mad/2.jpeg" alt="Madinah second screenshot"> 
       </div> 
       <div class="item"> 
        <img src="img/mad/3.jpeg" alt="Madinah third screenshot"> 
       </div> 
       <div class="item"> 
        <img src="img/mad/4.jpeg" alt="Madinah fourth screenshot"> 
       </div> 
      </div> 
      <!-- Controls --> 
      <a class="left carousel-control" href="#madinah-carousel" role="button" data-slide="prev"> 
       <span class="icon-prev" aria-hidden="true"></span> 
       <span class="sr-only">Previous</span> 
      </a> 
      <a class="right carousel-control" href="#madinah-carousel" role="button" data-slide="next"> 
       <span class="icon-next" aria-hidden="true"></span> 
       <span class="sr-only">Next</span> 
      </a> 
     </div> 

我試過,在小提琴和它的加工。

Regards

+0

是它的工作了,太感謝你了,我不知道爲什麼的文件將其列爲DIV CLASS =「旋轉木馬項目「這很奇怪! –

+1

我剛剛檢查過,它是bootstrap v4 alpha旋轉木馬項目類。 我用你的旋轉木馬從w3學校這個文件。 http://www.w3schools.com/bootstrap/bootstrap_carousel.asp –