0

I'm fairly new to Bootstrap. My carousel won't move forward or go back. Here's the code:

[code]

<html>
<head>
    <link rel="Stylesheet" type="text/css" href="css/bootstrap.css" />
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $('.carousel').carousel();
        });
    </script>
</head>
<body>
<center>
<div class="container">
<div class="row">
<div class="span6 well">
<div id="myCarousel" class="carousel">
<div class="carousel-inner">
<div class="item"><img src="1.jpg"></div>
<div class="item active"><img src="2.jpg"></div>
<div class="item"><img src="3.jpg"></div>
<div class="item"><img src="4.jpg"></div>
</div>
<a class="carousel-control left" href="#myCarousel" data-slide="prev">&lsaquo;</a>
<a class="carousel-control right" href="#myCarousel" data-slide="next">&rsaquo;</a>
</div>
</div>
</div>
</div>
<script src="carousel.js"></script>
</center>
</body>
</html>

Can someone please tell me what I'm doing wrong?

Any/All help is appreciated.

4

2 回答 2

2

make sure you added this (.js) in order and you point right to the folder that you put them in:

1- jquery library

2- js for bootstrap 3

3- your carousel js

example:

<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
<script src="bootstrap.min.js"></script>
<script src="carousel.js"></script>

hope this will help you

于 2013-10-09T19:44:23.250 回答
0

Tested

<script src="carousel.js"></script>

 <div id="myCarousel" class="carousel slide" >

        <!-- Wrapper for slides -->
        <div class="carousel-inner">
   <div class="item"><img src="1.jpg"></div>
<div class="item active"><img src="2.jpg"></div>
<div class="item"><img src="3.jpg"></div>
<div class="item"><img src="4.jpg"></div>
        </div>
       <!-- Controls-->
  <a class="left carousel-control" href="#myCarousel" data-slide="prev">
    <span class="icon-prev"></span>
  </a>
  <a class="right carousel-control" href="#myCarousel" data-slide="next">
    <span class="icon-next"></span>
  </a> 
      </div>
      <!-- /.carousel -->

  <script>
$('#myCarousel').carousel
({
    interval: 2000,


    })

</script>
于 2013-10-09T18:33:08.240 回答