Skip to content

Commit

Permalink
Merge pull request woocommerce#614 from tiagonoronha/develop
Browse files Browse the repository at this point in the history
Make sure currentSlide is a number
  • Loading branch information
mattyza committed Jul 2, 2013
2 parents 5ec3b74 + 7519455 commit be8d1f7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion jquery.flexslider.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(' '));
Expand Down

0 comments on commit be8d1f7

Please sign in to comment.