gpt4 book ai didi

javascript - 跳过 Bootstrap Carousel 中隐藏的幻灯片

转载 作者:行者123 更新时间:2023-11-29 15:26:35 26 4
gpt4 key购买 nike

我想知道是否有一种方法可以使用 Bootstrap 轮播来跳过隐藏的幻灯片。我可以使用 ng-show() 显示和隐藏幻灯片,但是轮播仍然转到空白幻灯片。只是想知道我是否可以为 prev 或 next 创建一个函数,该函数转到下一张幻灯片,其中 ng-show() = true?

<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>

最佳答案

也许这可以帮到你:

查看 bootstrap carousel 文档 here

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

检查这个link .

You can take a look at the link and check what is going on when you click on the next or prev buttons. The link is a source to w3schools where you can "try it".

关于javascript - 跳过 Bootstrap Carousel 中隐藏的幻灯片,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38702993/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com