I have the latest Bootstrap, and I have a carousel somewhere on my page with indicators outside the main carousel div.
My carousel:
<div class="background-carousel"> <div class="carousel slide carousel-fade" id="carousel-home" data-ride="carousel1"> <div class="carousel-inner" role="listbox" id="carousel-inner-home"> <div data-slide-no="0" class="item carousel-item active" style="background-image:url(<?php echo get_template_directory_uri(); ?>/assets/img/home-bg-1.png)"> </div> <div data-slide-no="1" class="item carousel-item" style="background-image:url(<?php echo get_template_directory_uri(); ?>/assets/img/grass.jpg)"> </div> <div data-slide-no="2" class="item carousel-item" style="background-image:url(<?php echo get_template_directory_uri(); ?>/assets/img/grass2.jpg)"> </div> <div data-slide-no="3" class="item carousel-item" style="background-image:url(<?php echo get_template_directory_uri(); ?>/assets/img/grass3.jpg)"> </div> </div> </div> </div>
Then I have my indicators, where on the page:
<div class="home-carousel-indicators"> <ol class="carousel-indicators"> <li data-target="#carousel-home" data-slide-to="0" class="carousel-switcher active"></li> <li data-target="#carousel-home" data-slide-to="1" class="carousel-switcher"></li> <li data-target="#carousel-home" data-slide-to="2" class="carousel-switcher"></li> <li data-target="#carousel-home" data-slide-to="3" class="carousel-switcher"></li> </ol> </div>
When the carousel switches images, the indicators do not change. I also had to use a workaround to get them to change the carousel when pressed.
Summarizing:
- My carousel works great.
- My carousel indicators are outside the carousel.
- The indicators do not switch automatically when the carousel is running.
- I had to use a jQuery workaround to capture indicators when clicking on them.
jquery html css twitter-bootstrap carousel
Daniel Dewhurst
source share