不行我使用引導旋轉木馬在SPA使用此代碼。我是新的自舉旋轉木馬「下一步」,「上一頁」功能在單頁應用SPA
<div id="myCarousel" class="carousel slide" data-ride="carousel" data-interval="false">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
<li data-target="#myCarousel" data-slide-to="1"></li>
<li data-target="#myCarousel" data-slide-to="2"></li>
<li data-target="#myCarousel" data-slide-to="3"></li>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
<div class="item active">
<a href="#discription" role="image">
<img src="cloth5.jpg" alt="Loading..." width="100%" height="auto">
</a>
</div>
<div class="item">
<img src="cloth5.jpg" alt="Loading..." width="460" height="345">
</div>
<div class="item">
<img src="menjeans.jpg" alt="Loading..." width="460" height="345">
</div>
<div class="item">
<img src="menjeans.jpg" alt="Loading..." width="460" height="345">
</div>
</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>
但是當我點擊Next
或Prev
是找到#myCarousel
頁面箭頭按鈕,而顯示下一張幻燈片。請幫我做什麼。
A.任何錯誤'? B.你應該叫'$( 「#myCarousel」)轉盤();'後,一旦轉盤添加到DOM。嘗試一下,讓我知道。 –