From c984ccf7aa609d1e8fee46d45990d462788ec866 Mon Sep 17 00:00:00 2001 From: caphun Date: Wed, 10 Jul 2013 12:26:03 +0800 Subject: [PATCH 1/2] fixes #149 - fixes problem with visibility of slides if items are less than carouselVisible. Also stops the slides from advancing. --- jquery.cycle2.carousel.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/jquery.cycle2.carousel.js b/jquery.cycle2.carousel.js index aa45d57..4f197e7 100644 --- a/jquery.cycle2.carousel.js +++ b/jquery.cycle2.carousel.js @@ -43,8 +43,6 @@ $.fn.cycle.transitions.carousel = { postInit: function( opts ) { var i, j, slide, pagerCutoffIndex, wrap; var vert = opts.carouselVertical; - if (opts.carouselVisible && opts.carouselVisible > opts.slideCount) - opts.carouselVisible = opts.slideCount - 1; var visCount = opts.carouselVisible || opts.slides.length; var slideCSS = { display: vert ? 'block' : 'inline-block', position: 'static' }; From 85eb2eea1173d8bd75aad07b59e031de187ce1cf Mon Sep 17 00:00:00 2001 From: caphun Date: Wed, 10 Jul 2013 12:44:37 +0800 Subject: [PATCH 2/2] #149 - properly disables right nav if items less than or eq carouselVisible. --- jquery.cycle2.carousel.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/jquery.cycle2.carousel.js b/jquery.cycle2.carousel.js index 4f197e7..3fcc9d7 100644 --- a/jquery.cycle2.carousel.js +++ b/jquery.cycle2.carousel.js @@ -36,7 +36,11 @@ $.fn.cycle.transitions.carousel = { // issue #10 for (var i=0; i < opts.startingSlide; i++) { opts.container.append( opts.slides[0] ); - } + } + + if (opts.slideCount <= opts.carouselVisible) + opts._nextBoundry = 0; + }, // transition API impl