i'm using cycle slider carousel (http://jquery.malsup.com/cycle2/demo/carousel.php), , depending on screen size have change 5 3 , 1 slide shown (the carousel-visible option).
i know how watch width of page trigger function change when falling below threshold, function call change number of slides shown?
$(window).resize(function () { onresize(); }); $(window).load(function () { onresize(); }); function onresize() { if ($('body').outerwidth() < 640) { $('.slideshow').attr({'data-cycle-carousel-visible': 'number of element want show'}); } else { if ($('body').outerwidth() > 640 && $('body').outerwidth() < 1024) { $('.slideshow').attr({'data-cycle-carousel-visible': 'number of element want show'}); } else { $('.slideshow').attr({'data-cycle-carousel-visible': 'number of element want show'}); } } }
enjoy :)
Comments
Post a Comment