Skip to content
Browse files

Merge pull request #614 from tiagonoronha/develop

Make sure currentSlide is a number
  • Loading branch information...
2 parents 5ec3b74 + 7519455 commit be8d1f7ed125279cfb042a5bef173673b2a25fce @mattyza mattyza committed Jul 2, 2013
Showing with 3 additions and 1 deletion.
  1. +3 −1 jquery.flexslider.js
View
4 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(' '));

0 comments on commit be8d1f7

Please sign in to comment.
Something went wrong with that request. Please try again.