javascript - Bootstrap Carousel is not showing up on the page -
i trying add bootstrap carousel, when inspect element, dom available not showing up.
i using customized bootstrap library downloaded form link:
what missing in template.
this tried:
html:
<div id="mycarousel" class="carousel slide" data-ride="carousel"> <!-- indicators --> <ol class="carousel-indicators"> <li data-target="#mycarousel" data-slide-to="0" class="active"></li> <li data-target="#mycarousel" data-slide-to="1" class=""></li> <li data-target="#mycarousel" data-slide-to="2" class=""></li> </ol> <div class="carousel-inner" role="listbox"> <div class="item active"> <img class="first-slide" src="data:image/gif;base64,r0lgodlhaqabaiaaahd3dwaaach5baaaaaaalaaaaaabaaeaaaicraeaow==" alt="first slide"> <div class="container"> <div class="carousel-caption"> <h1>example headline.</h1> <p>note: if you're viewing page via <code>file://</code> url, "next" , "previous" glyphicon buttons on left , right might not load/display due web browser security rules.</p> <p><a class="btn btn-lg btn-primary" href="#" role="button">sign today</a></p> </div> </div> </div> <div class="item"> <img class="second-slide" src="data:image/gif;base64,r0lgodlhaqabaiaaahd3dwaaach5baaaaaaalaaaaaabaaeaaaicraeaow==" alt="second slide"> <div class="container"> <div class="carousel-caption"> <h1>another example headline.</h1> <p>cras justo odio, dapibus ac facilisis in, egestas eget quam. donec id elit non mi porta gravida @ eget metus. nullam id dolor id nibh ultricies vehicula ut id elit.</p> <p><a class="btn btn-lg btn-primary" href="#" role="button">learn more</a></p> </div> </div> </div> <div class="item"> <img class="third-slide" src="data:image/gif;base64,r0lgodlhaqabaiaaahd3dwaaach5baaaaaaalaaaaaabaaeaaaicraeaow==" alt="third slide"> <div class="container"> <div class="carousel-caption"> <h1>one more measure.</h1> <p>cras justo odio, dapibus ac facilisis in, egestas eget quam. donec id elit non mi porta gravida @ eget metus. nullam id dolor id nibh ultricies vehicula ut id elit.</p> <p><a class="btn btn-lg btn-primary" href="#" role="button">browse gallery</a></p> </div> </div> </div> </div> <a class="left carousel-control" href="#mycarousel" role="button" data-slide="prev"> <span class="glyphicon glyphicon-chevron-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="glyphicon glyphicon-chevron-right" aria-hidden="true"></span> <span class="sr-only">next</span> </a> </div>
js:
$('#mycarousel').carousel();
every thing fine in code need have image height , width use below css solve issue.
.carousel-inner > .item >img{ min-height : 300px; max-height : 300px; width : 100%; }
Comments
Post a Comment