简体   繁体   English

显示带有引导轮播的预览(上一张和下一张图片)

[英]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.

相关问题 在Twitter Bootstrap Carousel中显示下一张和上一张图片 - Show next and previous image in Twitter Bootstrap Carousel 单击引导轮播中的下一个或上一个时,图像会跳转 - Image jumps when click on next or previous on bootstrap carousel 带有下一张和上一张图像预览的轮播 - Carousel with preview of the next and previous image 在bootstrap Carousel中显示下一个图像 - Show the next image in bootstrap Carousel Bootstrap Carousel 幻灯片对于“NEXT”不平滑,但对于“PREVIOUS”来说是平滑的 - Bootstrap Carousel slide is not smooth for "NEXT" but smooth for "PREVIOUS" 在 bootstrap 4 carousel 中为上一张和下一张幻灯片制作动画 - Animate previous and next slide in bootstrap 4 carousel 引导轮播下一个和上一个图像不显示 - bootstrap carousel next and previous images not displaying 如何在轮播中将上一个和下一个图像嵌入上一个和下一个按钮 - How to embed the previous and next image in the previous and next button in a carousel 如何使twitter bootstrap 3轮播中心处于活动图像的中心,并显示下一张和上一张图像的一部分? - How can I make twitter bootstrap 3 carousel centre the active image and show part of the next and previous images? 如何使图像轮播控件“下一个”和“上一个” - How to make Image Carousel Controls 'next' and 'previous'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM