2013-02-14 60 views

回答

0

flexslider不支持多行。您必須自己編碼或讓某人爲您添加功能

2

嘗試使用此方法。 我試圖和它的工作對我來說:)

function make2Rows(iWidth) { 
    var iHeight = parseFloat($('.flexslider .slides > li').height()); 
    $('.alliance-list .slides > li').css('width', iWidth+'px'); 
    $('.alliance-list .slides > li:nth-child(even)').css('margin', iHeight+'px 0px 0px -'+iWidth+'px'); 
} 

$(window).load(function() { 
    var itemCnt = 5; // this will be the number of columns per row 
    var iWidth = parseFloat($('.flexslider').width()/itemCnt); 
    $('.flexslider').flexslider({ 
     animation: "slide", 
     slideshowSpeed: 1000, 
     animationSpeed: 300, 
     animationLoop: false, 
     directionNav: false, 
     slideshow: false, 
     touch: true, 
     itemWidth: iWidth, 
     minItems: itemCnt, 
     maxItems: itemCnt, 
     start: make2Rows(iWidth) 
    }); 
}); 

它爲2行。它定義了一個函數來爲偶數幻燈片添加邊距,以使它們變得奇怪。 這種解決方案的來源是在這裏:

http://paulgonzaga.blogspot.com.es/2014/02/how-to-create-multiple-row-carousel-on.html?m=1

0

創建兩個單獨的滑塊,並在那裏你在Javascript中初始化它們使用前directionNav參數,使他們一起工作,如果他們是一個單一的兩排滑塊。這裏有一個例子:

#slider-row-1 .flex-direction-nav a { 
    top: 100%; 
} 
:所以它看起來像一個滑塊

$('#slider-row-1').flexslider({ 
    animation: "slide", 
    animationLoop: true, 
    before: function(slider){ 
     $('#slider-row-2').flexslider(slider.animatingTo); 
    }, // animates second row in sync with first row 
    controlNav: false, 
    directionNav: true, // shows navigation arrows 
    itemWidth: 210, 
    itemMargin: 5, 
    minItems: 4, 
    maxItems: 4, 
    slideshow: false 
    }); 

    $('#slider-row-2').flexslider({ 
    animation: "slide", 
    animationLoop: true, 
    controlNav: false, 
    directionNav: false, // hides navigation arrows 
    itemWidth: 210, 
    itemMargin: 5, 
    minItems: 4, 
    maxItems: 4, 
    slideshow: false 
    }); 

然後更新您的風格

相關問題