2016-08-01 51 views
2

我想知道是否有方法使用bootstrap旋轉木馬跳過隱藏的幻燈片。我能夠使用ng-show()顯示和隱藏幻燈片,但傳送帶仍然會顯示空白幻燈片。只是想知道如果我能爲prev或next創建一個函數,然後進入下一張幻燈片,其中ng-show()= true?跳過Bootstrap Carousel中的隱藏幻燈片

<div class="carousel-inner" role="listbox"> 
    <div class="item active" ng-show="solution.check"> 
    <img src="img_chania.jpg" alt="Chania" width="460" height="345"> 
    </div> 

    <div class="item" ng-show="solution.check"> 
    <img src="img_chania2.jpg" alt="Chania" width="460" height="345"> 
    </div> 

    <!-- Left and right controls --> 
    <a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev"> 
    <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span> 
    <span class="sr-only">Previous</span> 
    </a> 
    <a class="right carousel-control" href="#myCarousel" role="button" data-slide="next"> 
    <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span> 
    <span class="sr-only">Next</span> 
    </a> 
</div> 

回答

0

也許這可以幫助你:

看一看引導旋轉木馬文件here

$("selector").on("slide.bs.carousel", function(){ 
    if($(nextslide).attr("ng-show") == false){ 
     // go to next element 
    } 
}); 

檢查這個link

你可以看看鏈接,並檢查當你點擊下一個或prev按鈕時發生了什麼。該鏈接是w3schools的來源,您可以在其中「嘗試」。

相關問題