diff --git a/jquery.flexslider.js b/jquery.flexslider.js index 66a286b7..9c0672b3 100644 --- a/jquery.flexslider.js +++ b/jquery.flexslider.js @@ -36,7 +36,9 @@ methods = { init: function() { slider.animating = false; - slider.currentSlide = slider.vars.startAt; + // Get current slide and make sure it is a number + slider.currentSlide = parseInt( ( slider.vars.startAt ? slider.vars.startAt : 0) ); + if ( isNaN( slider.currentSlide ) ) slider.currentSlide = 0; slider.animatingTo = slider.currentSlide; slider.atEnd = (slider.currentSlide === 0 || slider.currentSlide === slider.last); slider.containerSelector = slider.vars.selector.substr(0,slider.vars.selector.search(' '));