2016-08-08 36 views

回答

0
$(window).resize(function() { 
    onResize(); 
}); 
$(window).load(function() { 
    onResize(); 
}); 
function onResize() { 
    if ($('body').outerWidth() < 640) { 
     $('.slideshow').attr({'data-cycle-carousel-visible': 'number of element you want to show'}); 
    } else { 
     if ($('body').outerWidth() > 640 && $('body').outerWidth() < 1024) { 
       $('.slideshow').attr({'data-cycle-carousel-visible': 'number of element you want to show'}); 
     } else { 
       $('.slideshow').attr({'data-cycle-carousel-visible': 'number of element you want to show'}); 
     } 
    } 
} 

享受:)

+0

更改屬性初始化經歷了不工作後。如果只是這會很簡單 – Fredy31

相關問題