2015-11-29 65 views
0

幫我調試我的旋轉木馬的PHP代碼,它不會滑開,我錯過了什麼? 我希望它在頁面加載時進行自動滑動,而不是當我點擊指標時不會滑動。旋轉木馬顯示完美,但不會滑動

echo '<div id="myCarousel" class="carousel slide" data-ride="carousel">'; 
    echo ' 
    <ol class="carousel-indicators"> 
    <li data-target="#myCarousel" data-slide-to="0" class="active"></li> 
    <li data-target="#myCarousel" data-slide-to="1"></li> 
    </ol>'; 

    echo '<div class="carousel-inner" role="listbox">'; 

    echo '<div class="item active">'; 
    echo '<div class="jumbotron" style="border:solid 3px;height:500px;margin-top:20px">'; 
    echo '<div class="containeractive col-md-6" 
     style="height:400px;border:solid 2px; margin: 0px 50px 10px 20px; 
     background-image:url('.$row['image'].');background-repeat:no-repeat;background-size:contain; background-position:center"></div>'; 
    echo '<div class="container col-md-5" style="height:85px;border:solid 3px;margin-bottom:30px">'.$row['name'].'</div>'; 
    echo '<div class="container col-md-5" style="height: 285px; border:solid 3px;">'.$row['description'].'</div>'; 
    echo '</div>'; 
    echo '</div>'; 

    mysqli_data_seek($result,1); 
    $row2 = mysqli_fetch_array ($result); 

    echo '<div class="item">'; 
    echo '<div class="jumbotron" style="border:solid 3px;height:500px;margin-top:20px">'; 
    echo '<div class="container col-md-6" 
     style="height:400px;border:solid 2px; margin: 0px 50px 10px 20px; 
     background-image:url('.$row2['image'].');background-repeat:no-repeat;background-size:contain; background-position:center"></div>'; 
    echo '<div class="container col-md-5" style="height:85px;border:solid 3px;margin-bottom:30px">'.$row2['name'].'</div>'; 
    echo '<div class="container col-md-5" style="height: 285px; border:solid 3px;">'.$row2['description'].'</div>'; 
    echo '</div>'; 
    echo '</div>'; 

    echo '</div>'; 
    echo '</div>'; 
+0

您是否在您的頁面上包含了Bootstrap JavaScript文件的鏈接? https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js –

回答

0

您沒有添加引導程序的JavaScript。只需將其添加到正文部分的末尾

<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>