-5
How do I make a rotating banner with Bootstrap? I searched the Bootstrap documentation, but I didn’t see anything related to rotating banner. How do I do?
In fact what I want is to keep you showing various images, I call rotary banner, that is, calls one image and after a few seconds calls another and so on.
See my code below. The problem is that the PREV and NEXT button are missing, in fact now only the PREV. Something else. When the site enters, the first image appears. When I give a NEXT, it goes to the third image and not to the second and the button disappears. If I give a PREV, it goes back to the second image and not the third (I have only 3 images). See the code below.
<!DOCTYPE html>
<html>
<head>
<title></title>
<script src="~/Scripts/jquery-1.10.2.min.js"></script>
<link href="~/Content/bootstrap.css" rel="stylesheet" />
<script src="~/Scripts/bootstrap.min.js" type="text/javascript"></script>
<script src="~/Scripts/bootstrap.js" type="text/javascript"></script>
</head>
<body>
<div id="bannerRotativo" >
<ol class="carousel-indicators">
<li data-target="#bannerRotativo" data-slide-to="0" class="active"></li>
<li data-target="#bannerRotativo" data-slide-to="1" ></li>
<li data-target="#bannerRotativo" data-slide-to="2" ></li>
</ol>
<div class="carousel-inner">
<div class="item active">
<img src="~/Images/imagem_1.jpg" alt="..." height="900" width="500">
<div class="carousel-caption">
...
</div>
</div>
<div class="item">
<img src="~/Images/imagem_2.jpg" alt="..." height="900" width="500">
<div class="carousel-caption">
...
</div>
</div>
<div class="item">
<img src="~/Images/imagem_3.jpg" alt="..." height="900" width="500">
<div class="carousel-caption">
...
</div>
...
</div>
<a class="left carousel-control" href="#bannerRotativo" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left"></span>
</a>
<a class="right carousel-control" href="#bannerRotativo" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right"></span>
</a>
</div>
<div class="navbar navbar-inverse">
<div class="Container">
<ul class="nav navbar-nav">
<li><a href="#">Home</a></li>
<li><a href="#about">Technologies</a></li>
<li><a href="#contact">Article</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">blog<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#">Cadastro</a></li>
<li><a href="#">Downloads</a></li>
<li><a href="#">Artigos</a></li>
<li><a href="#">Teste</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">News <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#">Home</a></li>
<li><a href="#">Technologies</a></li>
<li><a href="#">Article</a></li>
<li><a href="#">blog</a></li>
</ul>
</li>
</ul>
</div>
</div>
<div id="">
</div>
<script type="text/javascript">
$(document).ready(function () {
$('.dropdown-toggle').dropdown();
});
</script>
</body>
</html>
I didn’t understand the down vote
– pnet
Is that "rotating banner" doesn’t explain much what you want.
– user7261
The Bootstrap API has examples yes: http://getbootstrap.com/javascript/#Carousel
– Gustavo Sales
It is the bootstrap Carousel, below has an answer.
– Marcelo Aymone
Do not care no, @pnet, it is common to rain downvote without reason or explanation.
– Bruno Augusto
Maybe your issue invalidated the answers already given, setting up a chameleon question... If that’s the case, you’d better open a new one.
– brasofilo
It is complicated this forum. If the question does not agree with what some want, give me down vote. It is a joke.
– pnet
Good, is not a forum, is a Questions and Answers site. The negative votes went to the first version of your question. The second version should have been a new question. Apparently, you didn’t do the tour of the website nor is familiar with the [help] or with the [meta]...
– brasofilo