How can I hide one or two elements from the bootstrap carousel only in xs size?
When I added the "hidden-xs" class to this element in the carousel, and the div element looks like this:
<div class="item hidden-xs"> <img src="imgTop2.jpg" alt="..."> </div>
All items and the carousel have disappeared.
The same problem exists when I add the 'hidden-xs' class to the img element for this element.
How can i fix this? I want to hide on xs only one or two slides. Others must be visible.
My code looks like this:
<div id="carousel-top" class="carousel slide" data-ride="carousel"> <ol class="hidden carousel-indicators" style="display:none"> <li data-target="#carousel-top" data-slide-to="0" class="active"></li> <li class="" data-target="#carousel-top" data-slide-to="1"></li> <li class="" data-target="#carousel-top" data-slide-to="2"></li> </ol> <div class="carousel-inner" role="listbox"> <div class="item active"> <img src="imgTop.jpg" alt="..."> </div> <div class="item"> <img src="imgTop2.jpg" alt="..."> </div> <div class="item"> <img src="imgTop3.jpg" alt="..."> </div> <div class="item"> <img src="imgTop4.jpg" alt="..."> </div> <div class="item"> <img src="imgTop5.jpg" alt="..."> </div> </div> <a class="hidden left carousel-control" href="#carousel-top" role="button" data-slide="prev"> <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span> <span class="sr-only">Previous</span> </a> <a class="hidden right carousel-control" href="#carousel-top" role="button" data-slide="next"> <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span> <span class="sr-only">Next</span> </a> </div>
source share