0
By inserting multiple Carousel , by clicking on any other Carousel, only the first changes.
Someone can help me?
<section>
<div class="row">
<div class="col-lg-6">
<h3>Titulo nivel 3</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>
<div class="col-lg-6">
<!-- CAROUSEL-->
<div id="myCarousel" class="carousel slide" data-ride="carousel">
<div class="carousel-inner" role="listbox">
<div class="item active">
<img src="" alt="Chania">
<div class="carousel-caption">
<h3>Lorem ipsum dolor sit amet</h3>
<p>Details of Slide 1. Lorem Ipsum Blah Blah Blah....</p>
</div>
</div>
<div class="item">
<img src="" alt="Chania">
<div class="carousel-caption">
<h3>Header of Slide 2</h3>
<p>Details of Slide 2. Lorem Ipsum Blah Blah Blah....</p>
</div>
</div>
<div class="item">
<img src="" alt="Flower">
<div class="carousel-caption">
<h3>Header of Slide3</h3>
<p>Details of Slide 3. Lorem Ipsum Blah Blah Blah....</p>
</div>
</div>
</div>
<!-- << Controladores >> -->
<a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
<span class="fa fa-angle-left" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
<span class="fa fa-angle-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
<!-- Indicadores 0 0 0-->
<ol class="carousel-indicators">
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
<li data-target="#myCarousel" data-slide-to="1"></li>
<li data-target="#myCarousel" data-slide-to="2"></li>
</ol>
</div>
<!--FIM CAROUSEL -->
</div>
</div>
</section>
<section>
<div class="row">
<div class="col-lg-6">
<!-- CAROUSEL-->
<div id="myCarousel" class="carousel slide" data-ride="carousel">
<div class="carousel-inner" role="listbox">
<div class="item active">
<img src="" alt="Chania">
<div class="carousel-caption">
<h3>Lorem ipsum dolor sit amet</h3>
<p>Details of Slide 1. Lorem Ipsum Blah Blah Blah....</p>
</div>
</div>
<div class="item">
<img src="" alt="Chania">
<div class="carousel-caption">
<h3>Header of Slide 2</h3>
<p>Details of Slide 2. Lorem Ipsum Blah Blah Blah....</p>
</div>
</div>
<div class="item">
<img src="" alt="Flower">
<div class="carousel-caption">
<h3>Header of Slide3</h3>
<p>Details of Slide 3. Lorem Ipsum Blah Blah Blah....</p>
</div>
</div>
</div>
<!-- << Controladores >> -->
<a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
<span class="fa fa-angle-left" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
<span class="fa fa-angle-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
<!-- Indicadores 0 0 0-->
<ol class="carousel-indicators">
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
<li data-target="#myCarousel" data-slide-to="1"></li>
<li data-target="#myCarousel" data-slide-to="2"></li>
</ol>
</div>
<!--FIM CAROUSEL -->
</div>
<div class="col-lg-6">
<h3>Titulo nivel 3</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>
</div>
</section>
<section>
<div class="row">
<div class="col-lg-6">
<h3>Titulo nivel 3</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>
<div class="col-lg-6">
<!-- CAROUSEL-->
<div id="myCarousel" class="carousel slide" data-ride="carousel">
<div class="carousel-inner" role="listbox">
<div class="item active">
<img src="" alt="Chania">
<div class="carousel-caption">
<h3>Lorem ipsum dolor sit amet</h3>
<p>Details of Slide 1. Lorem Ipsum Blah Blah Blah....</p>
</div>
</div>
<div class="item">
<img src="" alt="Chania">
<div class="carousel-caption">
<h3>Header of Slide 2</h3>
<p>Details of Slide 2. Lorem Ipsum Blah Blah Blah....</p>
</div>
</div>
<div class="item">
<img src="" alt="Flower">
<div class="carousel-caption">
<h3>Header of Slide3</h3>
<p>Details of Slide 3. Lorem Ipsum Blah Blah Blah....</p>
</div>
</div>
</div>
<!-- << Controladores >> -->
<a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
<span class="fa fa-angle-left" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
<span class="fa fa-angle-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
<!-- Indicadores 0 0 0-->
<ol class="carousel-indicators">
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
<li data-target="#myCarousel" data-slide-to="1"></li>
<li data-target="#myCarousel" data-slide-to="2"></li>
</ol>
</div>
<!--FIM CAROUSEL -->
</div>
</div>
</section>
<section>
<div class="row">
<div class="col-lg-6">
<!-- CAROUSEL-->
<div id="myCarousel" class="carousel slide" data-ride="carousel">
<div class="carousel-inner" role="listbox">
<div class="item active">
<img src="" alt="Chania">
<div class="carousel-caption">
<h3>Lorem ipsum dolor sit amet</h3>
<p>Details of Slide 1. Lorem Ipsum Blah Blah Blah....</p>
</div>
</div>
<div class="item">
<img src="" alt="Chania">
<div class="carousel-caption">
<h3>Header of Slide 2</h3>
<p>Details of Slide 2. Lorem Ipsum Blah Blah Blah....</p>
</div>
</div>
<div class="item">
<img src="" alt="Flower">
<div class="carousel-caption">
<h3>Header of Slide3</h3>
<p>Details of Slide 3. Lorem Ipsum Blah Blah Blah....</p>
</div>
</div>
</div>
<!-- << Controladores >> -->
<a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
<span class="fa fa-angle-left" aria-hidden="true"></span>
<span class="sr-only">Ant</span>
</a>
<a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
<span class="fa fa-angle-right" aria-hidden="true"></span>
<span class="sr-only">Prx</span>
</a>
<!-- Indicadores 0 0 0-->
<ol class="carousel-indicators">
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
<li data-target="#myCarousel" data-slide-to="1"></li>
<li data-target="#myCarousel" data-slide-to="2"></li>
</ol>
</div>
<!--FIM CAROUSEL -->
</div>
<div class="col-lg-6">
<h3>Titulo nivel 3</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>
</div>
</section>
Please post your javascript code (jQuery) that makes the change in the Carousel so we can analyze. Probably the modification is being made by ID or by the first element with the class "Carousel".
– Bruno Bermann
The problem is probably in
id
that you’re using. From what I saw on Exphtml
that is using, all elements have the sameid
,id
is a unique attribute that theDOM
sees, when he references him byjquery
orjavascript
, he takes only the first element he finds– MarceloBoni
I managed to solve it myself.. My lack of attention.. really was the ID ! thanks anyway!
– Rafael Rotiroti