From 6239d8e7f67ed7cefcbb886b4749ba1bfb01893a Mon Sep 17 00:00:00 2001 From: Viljami S Date: Thu, 26 Apr 2012 20:28:00 +0300 Subject: [PATCH] adds waitTime variable --- responsiveslides.js | 11 ++++++----- responsiveslides.min.js | 10 +++++----- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/responsiveslides.js b/responsiveslides.js index 5ebd0d3..8d98266 100644 --- a/responsiveslides.js +++ b/responsiveslides.js @@ -45,7 +45,8 @@ index = 0, $slide = $this.children(), length = $slide.size(), - fadetime = parseFloat(settings.speed), + fadeTime = parseFloat(settings.speed), + waitTime = parseFloat(settings.timeout), maxw = parseFloat(settings.maxwidth), // Namespacing @@ -70,13 +71,13 @@ $this.trigger(namespace + "-before"); $slide .stop() - .fadeOut(fadetime, function () { + .fadeOut(fadeTime, function () { $(this) .removeClass(visibleClass) .css(hidden); }) .eq(idx) - .fadeIn(fadetime, function () { + .fadeIn(fadeTime, function () { $(this) .addClass(visibleClass) .css(visible) @@ -118,7 +119,7 @@ if ($slide.size() > 1) { // Make sure the timeout is at least 100ms longer than the fade - if (settings.timeout < settings.speed + 100) { + if (waitTime < fadeTime + 100) { return; } @@ -166,7 +167,7 @@ } slideTo(idx); - }, parseFloat(settings.timeout)); + }, waitTime); }; // Init cycle diff --git a/responsiveslides.min.js b/responsiveslides.min.js index 562b535..810a904 100644 --- a/responsiveslides.min.js +++ b/responsiveslides.min.js @@ -1,6 +1,6 @@ /*! http://responsiveslides.com v1.3 by @viljamis */ -(function(d,C,v){d.fn.responsiveSlides=function(i){var b=d.extend({auto:!0,speed:1E3,timeout:4E3,pager:!1,nav:!1,random:!1,pause:!1,pauseControls:!1,prevText:"Previous",nextText:"Next",maxwidth:"",controls:"",namespace:"rslides"},i);return this.each(function(){v++;var c=d(this),o,q,j,l,m,n=0,e=c.children(),w=e.size(),x=parseFloat(b.speed),r=parseFloat(b.maxwidth),g=b.namespace,h=g+v,f=g+"_nav "+h+"_nav",s=g+"_here",k=h+"_on",y=h+"_s",p=d("