[英]Showing previews (previous and next image) with bootstrap carousel
I am having an issue showing previews of the previous and next images/slides with bootstrap carousel. 我在显示带有引导轮播的上一个和下一个图像/幻灯片的预览时遇到问题。 I have followed the instructions in the this StackExchange article, but no matter how many times I start again and re-write it, it just wont show properly.
我已按照此 StackExchange文章中的说明进行操作,但是无论我重新启动并重新编写多少次,它都不会正确显示。
It keeps getting truncated and showing below. 它不断被截断并显示在下面。
I have created a Fiddle to demonstrate the issue. 我创建了一个小提琴来演示该问题。
I don't want to show much of the next slides, maybe 20px worth either side, mostly just to prompt the user to slide/swipe. 我不想显示很多下一张幻灯片,也许两边都值得20像素,主要是为了提示用户进行滑动/滑动。
.carousel {
overflow: hidden;
}
.carousel-inner {
width: 150%;
left: -25%;
}
.carousel-inner > .item.next,
.carousel-inner > .item.active.right {
-webkit-transform: translate3d(33%, 0, 0);
transform: translate3d(33%, 0, 0);
}
.carousel-inner > .item.prev,
.carousel-inner > .item.active.left {
-webkit-transform: translate3d(-33%, 0, 0);
transform: translate3d(-33%, 0, 0);
}
.carousel-control.left,
.carousel-control.right {
background: rgba(255, 255, 255, 0.3);
width: 25%;
}
Any help on where I have gone wrong would be greatly appreciated. 对于我出错了的任何帮助,将不胜感激。
Many Thanks 非常感谢
Anton 安东
I would suggest you not to reinvent the wheel and to choose a slider which already has the functionality you are looking for or at leas something similar. 我建议您不要重新发明轮子,而是选择已经具有您正在寻找的功能或具有类似功能的滑块。
In my opinion Slick is one of the best sliders and it comes with a huge amount of customisation possibilities. 在我看来, Slick是最好的滑块之一,它具有大量的自定义可能性。 In your case I would have a closer look the Center Mode of Slick .
在您的情况下,我将仔细研究Slick的“ 中心模式 ”。
All you have to do to achieve your goal is change the styling and the slidesToShow
property. 实现目标所需要做的就是更改样式和
slidesToShow
属性。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.