轮播指标以数字代替点,仅显示活动和最后

时间:2019-07-13 14:30:41

标签: bootstrap-4 carousel

我想将轮播指标设为数字而不是点,仅显示活动的和最后一个,以及最后一个滑块,例如数字6显示6中的6。

enter image description here

 .carousel-indicators
    {
      li{
        background-color: $color-1;
        border: 0 none;
        border-radius: 50%;
        height: 30px;
        margin: 3px;
        /* opacity: 0.5; */
        width: 30px;
        cursor: pointer;
        color: $white;
        text-indent: 0;
        text-align: center;
        line-height: 30px;
        display: none;
        &.active,&:last-child{
          display: block;
        }
        &.active,&:hover{
          background-color: rgba($color-1,.4);
          //opacity: 0.4;
        }
      }
    }
 <ol class="carousel-indicators">
                    <li data-target="#video-carousel-example2" data-slide-to="0" class="active">1</li>
                    <li data-target="#video-carousel-example2" data-slide-to="1">2</li>
                    <li data-target="#video-carousel-example2" data-slide-to="2">3</li>
                    <li data-target="#video-carousel-example2" data-slide-to="3">4</li>
                </ol>

0 个答案:

没有答案