How to change indicators and controls of a bootstrap carousel

I'm stuck trying to relocate indicators and carousel controls. This website looks something like this carousel. http://www.mitre10.co.nz/ There were indicators and controls below and away from the image.

Here is my live preview http://codepen.io/riwakawebsitedesigns/pen/qdiup

<header id="masterhead">
<div class="container">  
<div class="slideshow">
<div id="slideshow" class="carousel slide" data-ride="carousel">

          <ol class="carousel-indicators">   
            <li data-target="#slideshow" data-slide-to="0" class="active"></li>
            <li data-target="#slideshow" data-slide-to="1"></li>
            <li data-target="#slideshow" data-slide-to="2"></li>
    <li data-target="#slideshow" data-slide-to="3"></li>
        </ol>

        <div class="carousel-inner">

            <div class="item active">
          <img src="http://s20.postimg.org/wgz1zd3wd/slide1.jpg" alt="slide"/>
            </div>

            <div class="item">
          <img src="http://s20.postimg.org/l3cio5tdp/slide2.jpg" alt="slide"/>
            </div>

            <div class="item">
            <img src="http://s20.postimg.org/w0ducxg59/slide3.jpg" alt="slide"/>
            </div>

            <div class="item">
            <img src="http://s20.postimg.org/lrld73s3h/slide4.jpg" alt="slide"/>
            </div>

        </div>
        <a class="left carousel-control" href="#slideshow" data-slide="prev">
            <span class="glyphicon glyphicon-chevron-left"></span>
        </a>
        <a class="right carousel-control" href="#slideshow" data-slide="next">
            <span class="glyphicon glyphicon-chevron-right"></span>
        </a>
</div>

</div> 
</div>
</div>
</div>
</header>
+4
source share
3 answers

, , . CodePen, , :

<div class="carousel-controls">
    <a class="left carousel-control" href="#slideshow" data-slide="prev">
        <span class="glyphicon glyphicon-chevron-left"></span>
    </a>
    <ol class="carousel-indicators">   
        <li data-target="#slideshow" data-slide-to="0" class="active"></li>
        <li data-target="#slideshow" data-slide-to="1"></li>
        <li data-target="#slideshow" data-slide-to="2"></li>
        <li data-target="#slideshow" data-slide-to="3"></li>
    </ol>
    <a class="right carousel-control" href="#slideshow" data-slide="next">
        <span class="glyphicon glyphicon-chevron-right"></span>
    </a>
</div>

CSS

.carousel-controls{
 position:relative; 
  width:300px;
  margin:0 auto;
}

.carousel-indicators{
   top:0px; 
}

ref: http://codepen.io/anon/pen/tayfk/

+8

, .

http://codepen.io/TheNickelDime/

<!-- HTML -->

    <div class="Slideshow_carousel-wrapper container-fluid">
        <span class="Slideshow-ctl-L" onclick="carousel_left()"></span>
        <div class="carousel slide" data-ride="carousel"  ... </div>    
        <span class="Slideshow-ctl-R" onclick="carousel_right()"></span>

    </div>

<!-- /HTML -->

<!-- CSS -->

.Slideshow_carousel-wrapper {

    display: -webkit-flex;
    display:         flex;


    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    justify-content: center;

    text-align:center;

    width:100%; 
}



/* SLIDESHOW CONTROLS LEFT / RIGHT */
.Slideshow-ctl-L {

    -webkit-flex: none;
     flex: none;

    z-index:200;

    top:40%;
    margin-right:5px;

    height:60px;
    width:16px;

    opacity:0.7;

    background-size:15px 60px;
    background-repeat:no-repeat;
    background-image: url( ... );
}



.Slideshow-ctl-R {

    -webkit-flex: none;
     flex: none;


    top:40%;
    margin-left:5px;

    height:60px;
    width:15px;


    opacity:0.7;

    background-size:15px 60px;
    background-repeat:no-repeat;
    background-image: url( ... );
}

<!-- CSS -->
+1

You can edit bootstrap.js so that several classes are recognized as indicators.

var Carousel = function (element, options) {
    this.$element    = $(element)
    this.$indicators = this.$element.find('.carousel-indicators, .your-class-here')
0
source

Source: https://habr.com/ru/post/1534028/


All Articles