如何通过单击按钮强制引导轮播进入全屏模式?这是一个工作示例,这是我拥有的代码:
<div class="container">
<div class="well span9 columns">
<div id="myCarousel" class="carousel slide">
<div class="carousel-inner">
<div class="item active">
<img src="http://bootstrapdocs.com/v2.0.3/docs/assets/img/bootstrap-mdo-sfmoma-01.jpg" alt="" />
</div>
<div class="item">
<img src="http://bootstrapdocs.com/v2.0.3/docs/assets/img/bootstrap-mdo-sfmoma-02.jpg" alt="" />
</div>
<div class="item">
<img src="http://bootstrapdocs.com/v2.0.3/docs/assets/img/bootstrap-mdo-sfmoma-03.jpg" alt="" />
</div>
</div>
<a class="left carousel-control" href="#myCarousel" data-slide="prev">‹</a>
<a class="right carousel-control" href="#myCarousel" data-slide="next">›</a>
</div>
<button type="button" class="btn btn-inverse fulesize"><i class="icon-fullscreen icon-white"></i></button>
</div>
</div>
jQuery是:
$(".fulesize").click(function(){
$(".carousel-inner, .carousel, .item, .active ").addClass("full");
});
和 CSS:
html{height:100%;}
.full{height:100%;}