简体   繁体   English

如何使垂直图像缩略图滑块响应?

[英]how to make vertical image thumbnail slider responsive?

I am using bxSlider in my project.我在我的项目中使用bxSlider I want to make vertical and horizontal thumbnail slider with multiple images.我想用多个图像制作垂直和水平缩略图滑块。 I am using bootstrap framework in my project to achieve responsiveness.我在我的项目中使用引导框架来实现响应能力。 I using bxslider to make thmbnail slider for both horizontal and vertical.我使用 bxslider 制作水平和垂直的 thmbnail 滑块。 http://bxslider.com/examples/carousel-demystified#example http://bxslider.com/examples/carousel-demystified#example

Here is my Fiddle这是我的小提琴

Code:代码:

     $(document).ready(function() {
            $('#bxslider-vertical .bxslider').bxSlider({
                mode: 'vertical', 
                infiniteLoop: false,
                pager:false,
                slideWidth: 200,
                maxSlides: 3,
                minSlides: 3,                
                slideMargin: 10                                 
            });

             $('#bxslider-horizontal .bxslider').bxSlider({
                mode: 'horizontal', 
                infiniteLoop: false,
                pager:false,
                slideWidth: 200,
                maxSlides: 4,
                minSlides: 2,                
                slideMargin: 10 
            });
});

But as you see vertical slider is not at all responsive if i resize browser window ?但是如您所见,如果我调整浏览器窗口的大小,垂直滑块根本没有响应? And how to align image at center ?以及如何在中心对齐图像? As I have both portraits and landscape image.因为我有肖像和风景图像。

bxslider is a responsive content slider. bxslider 是一个响应式内容滑块。 However, for vertical slider you need to mention the number of slides that will be visible, and maxSlides attribute is not considered for vertical sliders.但是,对于垂直滑块,您需要提及可见的幻灯片数量,并且垂直滑块不考虑 maxSlides 属性。

Here's the fiddle这是小提琴

     $('#bxslider-vertical .bxslider').bxSlider({
                mode: 'vertical', 
                infiniteLoop: false,
                pager:false,
                slideWidth: 200,
                minSlides: 2,                
                slideMargin: 10                                 
            });

From their official documentation:从他们的官方文档:

Vertical carousels follow most of the same rules as horizontal carousels.垂直旋转木马遵循与水平旋转木马相同的大部分规则。 However, the maxSlides setting is not used as vertical carousels will always have only one slide across.但是,不使用 maxSlides 设置,因为垂直轮播将始终只有一张幻灯片。 Therefore, we do not have to accomodate different screen widths with this setting.因此,我们不必使用此设置适应不同的屏幕宽度。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM