How To End The Cell Till Right Arrow
I am using flickity slider. I am displaying each cell 26% and it's starting like below image which is correct for me. and it's ending like the below image. But I want to end my c
Solution 1:
Maybe by using the "contain" property :
$('.carousel').flickity({
freeScroll: true,
prevNextButtons: true,
pageDots: false,
draggable: false,
contain: true
});
* {
box-sizing: border-box;
}
body {
font-family: sans-serif;
}
.carousel {
background: #EEE;
}
.carousel-cell {
width: 26%;
height: 200px;
margin-right: 10px;
background: #8C8;
border-radius: 5px;
counter-increment: gallery-cell;
}
/* cell number */.carousel-cell:before {
display: block;
text-align: center;
content: counter(gallery-cell);
line-height: 200px;
font-size: 80px;
color: white;
}
<linkrel="stylesheet"href="https://unpkg.com/flickity@2/dist/flickity.min.css"><divclass="carousel"><divclass="carousel-cell"></div><divclass="carousel-cell"></div><divclass="carousel-cell"></div><divclass="carousel-cell"></div><divclass="carousel-cell"></div></div><scriptsrc="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script><scriptsrc="https://unpkg.com/flickity@2/dist/flickity.pkgd.min.js"></script>
Post a Comment for "How To End The Cell Till Right Arrow"