Skip to content

Commit

Permalink
Merge branch 'patbenatar-feature/allow-one-slide' into clean-develop
Browse files Browse the repository at this point in the history
  • Loading branch information
mattyza committed Jul 2, 2013
2 parents da021e3 + 7d5de65 commit b16ffc5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion README.mdown
Original file line number Diff line number Diff line change
Expand Up @@ -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.
3 changes: 2 additions & 1 deletion jquery.flexslider.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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) {
Expand Down

0 comments on commit b16ffc5

Please sign in to comment.