Permalink
Browse files

Merge branch 'patbenatar-feature/allow-one-slide' into clean-develop

  • Loading branch information...
2 parents da021e3 + 7d5de65 commit b16ffc5bd916095ca737c5c2f1bf9215038e18df @mattyza mattyza committed Jul 2, 2013
Showing with 6 additions and 2 deletions.
  1. +4 −1 README.mdown
  2. +2 −1 jquery.flexslider.js
View
@@ -138,4 +138,7 @@ Description to be added.
`added()` is a new callback event fired in the new slider.addSlide() function.
### removed: *{new}*
-`removed()` is a new callback event fired in the new slider.removeSlide() function.
+`removed()` is a new callback event fired in the new slider.removeSlide() function.
+
+### allowOneSlide: *{new}*
+Boolean. Whether or not you'd like FlexSlider to initialize as usual if only one slide is present.
@@ -1040,6 +1040,7 @@
minItems: 1, //{NEW} Integer: Minimum number of carousel items that should be visible. Items will resize fluidly when below this.
maxItems: 0, //{NEW} Integer: Maxmimum number of carousel items that should be visible. Items will resize fluidly when above this limit.
move: 0, //{NEW} Integer: Number of carousel items that should move on animation. If 0, slider will move all visible items.
+ allowOneSlide: true, //{NEW} Boolean: Whether or not to allow a slider comprised of a single slide
// Callback API
start: function(){}, //Callback: function(slider) - Fires when the slider loads the first slide
@@ -1061,7 +1062,7 @@
selector = (options.selector) ? options.selector : ".slides > li",
$slides = $this.find(selector);
- if ($slides.length === 1) {
+ if ( ( $slides.length === 1 && options.allowOneSlide === true ) || $slides.length === 0 ) {
$slides.fadeIn(400);
if (options.start) options.start($this);
} else if ($this.data('flexslider') === undefined) {

0 comments on commit b16ffc5

Please sign in to comment.