Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Carousel stop sliding when reaching the last item. #3611

Closed
qiangrw opened this issue May 27, 2012 · 4 comments
Closed

Carousel stop sliding when reaching the last item. #3611

qiangrw opened this issue May 27, 2012 · 4 comments

Comments

@qiangrw
Copy link

qiangrw commented May 27, 2012

Carousel does not start sliding to the first item when reaching the last one.
why? I just do as the carousel example did.

My Environment: Win7 + Chrome
Code:

<link rel="stylesheet" href="./css/bootstrap.min.css" />
<link rel="stylesheet" href="./css/bootstrap-responsive.min.css" />
<script src="./js/jquery.js">
</script><script src="./js/bootstrap.min.js"></script>
<script type="text/javascript">
    $(function() {
        $('#myCarousel').carousel({
            interval:2000
        })
    })
</script>

<div id="myCarousel" class="carousel slide">
            <div class="carousel-inner">
              <div class="active item">
                <img src="./img/bootstrap-mdo-sfmoma-01.jpg" alt="">
                <div class="carousel-caption">
                  <h4>First Thumbnail label</h4>
                  <p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>
                </div>
              </div>
              <div class="item">
                <img src="./img/bootstrap-mdo-sfmoma-02.jpg" alt="">
                <div class="carousel-caption">
                  <h4>Second Thumbnail label</h4>
                  <p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>
                </div>
              </div>
              <div class="item">
                <img src="./img/bootstrap-mdo-sfmoma-03.jpg" alt="">
                <div class="carousel-caption">
                  <h4>Third Thumbnail label</h4>
                  <p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>
                </div>
              </div>
            </div>
            <a class="left carousel-control" href="#myCarousel" data-slide="prev">&lsaquo;</a>
            <a class="right carousel-control" href="#myCarousel" data-slide="next">&rsaquo;</a>
    </div>
@mdo
Copy link
Member

mdo commented May 28, 2012

The carousel works as expected in the docs, so double check your code against that. I can already see that your example is missing a closing div tag at the end, so that might have something to do with it.

@mdo mdo closed this as completed May 28, 2012
@qiangrw
Copy link
Author

qiangrw commented Jun 9, 2012

THX, markdotto, but this is not my code problem.
And I found my answer in issue 2036 #2036

Deleting line 86 in bootstrap-carousel.js which is,

if (!$next.length) return

@pokonski
Copy link
Contributor

pokonski commented Jun 9, 2012

@qiangrw, are you sure you are running the latest 2.0.4 version? That problem was present in < 2.0.2 which as you can read in the #2036, Jacob fixed.

@qiangrw
Copy link
Author

qiangrw commented Jun 9, 2012

@pokonski My version is 2.0.1. All make sense ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants