我正在尝试从轮播图像启动模式。我找到了一些相关的线程,但没有一个建议对我有用的代码。下面是轮播代码,但我想知道如何实现与它相关的模态代码..?任何帮助将不胜感激!
<div id="well">
<div id="myCarousel" class="carousel slide">
<!-- Carousel items -->
<div class="carousel-inner">
<div class="item active">
<div class="row-fluid">
<div class="span3"><a href="OilBarrons" class="thumbnail"><img src="<%= asset_path( 'OilBarrons.jpg' ) %>" alt="Oil Barrons" style="max-width:100%;" /></a></div>
<div class="span3"><a href="OilBarrons" class="thumbnail"><img src="<%= asset_path( 'OilBarrons.jpg' ) %>" alt="Oil Barrons" style="max-width:100%;" /></a></div>
<div class="span3"><a href="OilBarrons" class="thumbnail"><img src="<%= asset_path( 'OilBarrons.jpg' ) %>" alt="Oil Barrons" style="max-width:100%;" /></a></div>
<div class="span3"><a href="OilBarrons" class="thumbnail"><img src="<%= asset_path( 'OilBarrons.jpg' ) %>" alt="Oil Barrons" style="max-width:100%;" /></a></div>
</div><!--/row-fluid-->
</div><!--/item-->
<div class="item">
<div class="row-fluid">
<div class="span3"><a href="OilBarrons" class="thumbnail"><img src="<%= asset_path( 'OilBarrons.jpg' ) %>" alt="Oil Barrons" style="max-width:100%;" /></a></div>
<div class="span3"><a href="OilBarrons" class="thumbnail"><img src="<%= asset_path( 'OilBarrons.jpg' ) %>" alt="Oil Barrons" style="max-width:100%;" /></a></div>
<div class="span3"><a href="OilBarrons" class="thumbnail"><img src="<%= asset_path( 'OilBarrons.jpg' ) %>" alt="Oil Barrons" style="max-width:100%;" /></a></div>
<div class="span3"><a href="OilBarrons" class="thumbnail"><img src="<%= asset_path( 'OilBarrons.jpg' ) %>" alt="Oil Barrons" style="max-width:100%;" /></a></div>
</div><!--/row-fluid-->
</div><!--/item-->
<div class="item">
<div class="row-fluid">
<div class="span3"><a href="#x" class="thumbnail"><img src="http://placehold.it/250x250" alt="Image" style="max-width:100%;" /></a></div>
<div class="span3"><a href="#x" class="thumbnail"><img src="http://placehold.it/250x250" alt="Image" style="max-width:100%;" /></a></div>
<div class="span3"><a href="#x" class="thumbnail"><img src="http://placehold.it/250x250" alt="Image" style="max-width:100%;" /></a></div>
<div class="span3"><a href="#x" class="thumbnail"><img src="http://placehold.it/250x250" alt="Image" style="max-width:100%;" /></a></div>
</div><!--/row-fluid-->
</div><!--/item-->
</div><!--/carousel-inner-->
<a class="left carousel-control" href="#myCarousel" data-slide="prev">‹</a>
<a class="right carousel-control" href="#myCarousel" data-slide="next">›</a>
</div><!--/myCarousel-->
</div><!--/well-->
<!-- Call jQuery 1.9, call bootstrap.js and run the carousel when the DOM is ready. Slide every 10 seconds. -->
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script src="assets/js/bootstrap-modal.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#myCarousel').carousel({
interval: 10000
})
});
</script>