0
我試圖從一個輪播圖像啓動一個模式。我找到了一些相關的線程,但都沒有提示代碼對我有用。下面是輪播代碼,但我想知道如何實現與它有關的模態代碼..?任何幫助將不勝感激!如何從引導傳送帶圖像啓動模態?
<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>