문제

So I want to make a little image gallery carousel. Four images across. And you can carousel over to more images. I found bxslider and it seemed like a quick, plug & play, solution. But it's only showing one image per slide.

I think I've followed their directions. But I've obviously done something wrong.

I've left their css and js untouched. My HTML looks like a copy of of theirs. And I put this at the end of their js file:

$(document).ready(function(){
    $('.bxslider').bxSlider({
        mode: 'fade',
        captions: true,
        auto: true,
        autoControls: false,
        minSlides: 4
    });
});

Here's the jsfiddle: http://jsfiddle.net/7YH8Q/

Anyone know how I can get this to work?

도움이 되었습니까?

해결책

The problem is you didn't set slideWidth. In order to setup a carousal, you have to provide 3 values, namely : slideWidth, minSlides, maxSlides.

Here's a working fiddle http://jsfiddle.net/hwQ6C/

$('.bxslider').bxSlider({
   slideWidth: 200,
   minSlides: 4,
   maxSlides: 5,
   slideMargin: 10
});

다른 팁

Multiple items per slides and fade mode is not currently supported. This has been flaged as an issue. Changing mode is the only option to fix this with bxslider.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top