Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Carousel Indicators should populate automatically depending on carousel items #7337

Closed
vinaykrsharma opened this Issue · 2 comments

3 participants

@vinaykrsharma

Carousel Indicators should populate automatically depending on carousel items
when .carousel item has a data attribute something like:

<div id="myCarousel" class="carousel slide" data-show-indicators="true">
...
</div>

Reason why I'm requesting is when I tried to append new carousel-item to carousel dynamically by using:

var new_item = "<div class='item'> \
        <img alt='' src='assets/img/bootstrap-mdo-sfmoma-01.jpg'> \
        <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>";

jQuery('#myCarousel').find('.carousel-inner').append(new_item);

then it works for carousel item but indicator count doesn't increases.

@al3x-edge

If you are already appending into the DOM, why not append in indicators as well? IMO, I don't think that dynamically adding new indicators would work out well as an implementation let alone trying to make it look natural.

@fat
Admin

what alex said

@fat fat closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.