0
使用傳送帶滑塊構建頁面。引導程序4傳送帶不工作
Bootsrap 4輪播不工作:
<div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
<ol class="carousel-indicators">
<li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li>
<li data-target="#carouselExampleIndicators" data-slide-to="1"></li>
<li data-target="#carouselExampleIndicators" data-slide-to="2"></li>
</ol>
<div class="carousel-inner" role="listbox">
<div class="carousel-item active">
<img class="d-block img-fluid" src="/wp-content/themes/tarps/assets/img/aaatarps-banner.png" alt="First slide">
</div>
<div class="carousel-item">
<img class="d-block img-fluid" src="/wp-content/themes/tarps/assets/img/aaatarps-banner.png" alt="Second slide">
</div>
<div class="carousel-item">
<img class="d-block img-fluid" src="..." alt="Third slide">
</div>
</div>
<a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
<script>
$('.carousel').carousel({
interval: 2000})
</script>
當我打開Chrome開發者工具,在瀏覽器控制檯顯示錯誤如下:
Uncaught ReferenceError: $ is not defined
不太知道我錯過了什麼?
該錯誤通常意味着jQuery未加載。你有沒有包含jQuery? –
是的,你是對的,我很愚蠢:)固定。鏈接到js的問題。 – TimothyAURA
你是否包含jquery? '' –