diff --git a/jquery.flexslider.js b/jquery.flexslider.js index d5563d43..1c420656 100644 --- a/jquery.flexslider.js +++ b/jquery.flexslider.js @@ -37,7 +37,7 @@ init: function() { slider.animating = false; // Get current slide and make sure it is a number - slider.currentSlide = parseInt( ( slider.vars.startAt ? slider.vars.startAt : 0) ); + slider.currentSlide = parseInt( ( slider.vars.startAt ? slider.vars.startAt : 0), 10 ); if ( isNaN( slider.currentSlide ) ) slider.currentSlide = 0; slider.animatingTo = slider.currentSlide; slider.atEnd = (slider.currentSlide === 0 || slider.currentSlide === slider.last); @@ -626,7 +626,7 @@ watchedEvent = ""; }, 3000); } - } + }; // public methods slider.flexAnimate = function(target, pause, override, withSync, fromNav) { @@ -738,7 +738,7 @@ // SMOOTH HEIGHT: if (slider.vars.smoothHeight) methods.smoothHeight(slider.vars.animationSpeed); } - } + }; slider.wrapup = function(dimension) { // SLIDE: if (!fade && !carousel) { @@ -752,12 +752,12 @@ slider.currentSlide = slider.animatingTo; // API: after() animation Callback slider.vars.after(slider); - } + }; // SLIDESHOW: slider.animateSlides = function() { if (!slider.animating && focused ) slider.flexAnimate(slider.getTarget("next")); - } + }; // SLIDESHOW: slider.pause = function() { clearInterval(slider.animatedSlides); @@ -767,7 +767,7 @@ if (slider.vars.pausePlay) methods.pausePlay.update("play"); // SYNC: if (slider.syncExists) methods.sync("pause"); - } + }; // SLIDESHOW: slider.play = function() { if (slider.playing) clearInterval(slider.animatedSlides); @@ -777,12 +777,12 @@ if (slider.vars.pausePlay) methods.pausePlay.update("pause"); // SYNC: if (slider.syncExists) methods.sync("play"); - } + }; // STOP: slider.stop = function () { slider.pause(); slider.stopped = true; - } + }; slider.canAdvance = function(target, fromNav) { // ASNAV: var last = (asNav) ? slider.pagingCount - 1 : slider.last; @@ -794,7 +794,7 @@ (slider.atEnd && slider.currentSlide === 0 && target === last && slider.direction !== "next") ? false : (slider.atEnd && slider.currentSlide === last && target === 0 && slider.direction === "next") ? false : true; - } + }; slider.getTarget = function(dir) { slider.direction = dir; if (dir === "next") { @@ -802,7 +802,7 @@ } else { return (slider.currentSlide === 0) ? slider.last : slider.currentSlide - 1; } - } + }; // SLIDE: slider.setProps = function(pos, special, dur) { @@ -836,7 +836,7 @@ slider.args[slider.prop] = target; if (slider.transitions || dur === undefined) slider.container.css(slider.args); - } + }; slider.setup = function(type) { // SLIDE: @@ -901,8 +901,7 @@ // !CAROUSEL: // CANDIDATE: active slide if (!carousel) slider.slides.removeClass(namespace + "active-slide").eq(slider.currentSlide).addClass(namespace + "active-slide"); - } - + }; slider.doMath = function() { var slide = slider.slides.first(), @@ -935,8 +934,7 @@ slider.last = slider.count - 1; } slider.computedW = slider.itemW - slider.boxPadding; - } - + }; slider.update = function(pos, action) { slider.doMath(); @@ -966,7 +964,7 @@ // update directionNav if (slider.vars.directionNav) methods.directionNav.update(); - } + }; slider.addSlide = function(obj, pos) { var $obj = $(obj); @@ -991,7 +989,7 @@ //FlexSlider: added() Callback slider.vars.added(slider); - } + }; slider.removeSlide = function(obj) { var pos = (isNaN(obj)) ? slider.slides.index($(obj)) : obj; @@ -1017,11 +1015,11 @@ // FlexSlider: removed() Callback slider.vars.removed(slider); - } + }; //FlexSlider: Initialize methods.init(); - } + }; // Ensure the slider isn't focussed if the window loses focus. $( window ).blur( function ( e ) { @@ -1091,8 +1089,7 @@ end: function(){}, //Callback: function(slider) - Fires when the slider reaches the last slide (asynchronous) added: function(){}, //{NEW} Callback: function(slider) - Fires after a slide is added removed: function(){} //{NEW} Callback: function(slider) - Fires after a slide is removed - } - + }; //FlexSlider: Plugin Function $.fn.flexslider = function(options) { @@ -1124,5 +1121,5 @@ default: if (typeof options === "number") $slider.flexAnimate(options, true); } } - } + }; })(jQuery);