Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Add wrap option to carousel #3528

Closed
wants to merge 8 commits into from

Conversation

rafaelumlei
Copy link

Sometimes applications require carousels that does not cycle continuously (having hard stops). This use case is already supported by the javascript Bootstrap library and is controlled using the wrap attribute. I implemented this feature in our carousel using plain angular.js by adding support for the wrap attribute in the carousel directive as in the following example:

    <carousel interval="myInterval" wrap="myWrap">
      <slide ng-repeat="slide in slides" active="slide.active">
        <img ng-src="{{slide.image}}" style="margin:auto;">
        <div class="carousel-caption">
          <h4>Slide {{$index}}</h4>
          <p>{{slide.text}}</p>
        </div>
      </slide>
    </carousel>

I've updated the tests, documentation and demo. The following images exemplify the final result with wrap="false" for the first, middle and last slides of a carousel.

first
middle
last

@rafaelumlei
Copy link
Author

It seems that somebody was already working on a similar Feature/Issue #3397. This version of the feature adds more functionality and is different in the way it hides the left (in first slide) and right (in the last slide) controls.

@chrisirhc
Copy link
Contributor

I believe this might be a duplicate of #3462 .

@wesleycho
Copy link
Contributor

Closing as duplicate

@wesleycho wesleycho closed this Jul 30, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants