Bootstrap Carousel Indicator with Numbers

In this example below you will see how to do a Bootstrap Carousel Indicator with Numbers with some HTML / CSS and Javascript

Thumbnail
This awesome code was written by danbhala, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright danbhala ©

Technologies

  • HTML
  • CSS
<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  <title>Bootstrap Carousel Indicator with Numbers</title>
  
  
  <link rel='stylesheet prefetch' href='http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css'>

      <link rel="stylesheet" href="css/style.css">

  
</head>

<body>

  <div class="container">
  <div class="page-header">
    <h1>Bootstrap carousel with number indicator</h1>
  </div>
</div>

<div class="container">
  <div id="carousel-example-generic" class="carousel slide">
  <!-- Indicators --> 
  <ol class="carousel-indicators carousel-indicators-numbers">
    <li data-target="#carousel-example-generic" data-slide-to="0" class="active">1</li>
    <li data-target="#carousel-example-generic" data-slide-to="1">2</li>
    <li data-target="#carousel-example-generic" data-slide-to="2">3</li>
  </ol>

  <!-- Wrapper for slides -->
  <div class="carousel-inner" role="listbox">
    <div class="item active">
      <img src="http://placehold.it/1200x500" alt="...">
    </div>
    <div class="item">
      <img src="http://placehold.it/1200x500" alt="...">
    </div>
    <div class="item">
      <img src="http://placehold.it/1200x500" alt="...">
    </div>
  </div>

  <!-- Controls -->
  <a class="left carousel-control" href="#carousel-example-generic" 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="#carousel-example-generic" role="button" data-slide="next">
    <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
    <span class="sr-only">Next</span>
  </a>
</div>
</div>
  <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js'></script>

  

</body>

</html>

/*Downloaded from https://www.codeseek.co/danbhala/bootstrap-carousel-indicator-with-numbers-gpWvxG */
.carousel-indicators-numbers li {
  text-indent: 0;
  margin: 0 2px;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 100%;
  line-height: 30px;
  color: #fff;
  background-color: #999;
  transition: all 0.25s ease;
}
.carousel-indicators-numbers li.active, .carousel-indicators-numbers li:hover {
  margin: 0 2px;
  width: 30px;
  height: 30px;
  background-color: #337ab7;
}

Comments