我正在尝试使用 Bootstrap CSS Carousel。左右箭头不起作用,幻灯片没有自动切换......我不知道为什么。
这是我的代码:
索引.php
<?php
include("header.php");
?>
<body>
<?php
include("menu.php");
include("carousel.php");
?>
<footer>
<p>© 2013 Company</p>
</footer>
<?php
include("script.php");
?>
<script>
!function ($) {
$(function(){
$('.carousel').carousel()
})
}(window.jQuery)
</script>
</body>
</html>
轮播.php
<div id="myCarousel" class="carousel slide">
<div class="carousel-inner">
<div class="item active">
<img src="img/bg1.jpg" alt="">
<div class="container">
<div class="carousel-caption">
<h1>ITEM 1</h1>
<p class="lead">Description 1.</p>
<a class="btn btn-large btn-primary" href="#">More</a>
</div>
</div>
</div>
<div class="item">
<img src="img/bg2.jpg" alt="">
<div class="container">
<div class="carousel-caption">
<h1>ITEM 2</h1>
<p class="lead">Description 2.</p>
<a class="btn btn-large btn-primary" href="#">More</a>
</div>
</div>
</div>
<div class="item">
<img src="img/bg3.jpg" alt="">
<div class="container">
<div class="carousel-caption">
<h1>ITEM 3</h1>
<p class="lead">Description 3.</p>
<a class="btn btn-large btn-primary" href="#">More</a>
</div>
</div>
</div>
</div>
<!-- Carousel NAV -->
<a class="left carousel-control" href="#myCarousel" data-slide="prev">‹</a>
<a class="right carousel-control" href="#myCarousel" data-slide="next">›</a>
</div>
script.php(*已编辑)
<script src="js/jquery.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/holder/holder.js"></script>
PS:我不能在 JS 中编程,也不能在 JQuery 中编程。