diff --git a/responsiveslides.js b/responsiveslides.js
index 05f081f..2976d75 100644
--- a/responsiveslides.js
+++ b/responsiveslides.js
@@ -27,8 +27,8 @@
"navContainer": "", // Selector: Where auto generated controls should be appended to, default is after the
"manualControls": "", // Selector: Declare custom pager navigation
"namespace": "rslides", // String: change the default namespace used
- before: $.noop, // Function: Before callback
- after: $.noop // Function: After callback
+ "before": $.noop, // Function: Before callback. Passed the index of the new slide.
+ "after": $.noop // Function: After callback. Passed the index of the new slide.
}, options);
return this.each(function () {
@@ -93,7 +93,7 @@
// Fading animation
slideTo = function (idx) {
- settings.before();
+ settings.before(idx);
// If CSS3 transitions are supported
if (supportsTransitions) {
$slide
@@ -104,7 +104,7 @@
.css(visible);
index = idx;
setTimeout(function () {
- settings.after();
+ settings.after(idx);
}, fadeTime);
// If not, use jQuery fallback
} else {
@@ -121,7 +121,7 @@
$(this)
.addClass(visibleClass)
.css(visible);
- settings.after();
+ settings.after(idx);
index = idx;
});
}
diff --git a/responsiveslides.min.js b/responsiveslides.min.js
index fdcff16..e615a0e 100644
--- a/responsiveslides.min.js
+++ b/responsiveslides.min.js
@@ -1,7 +1,7 @@
/*! http://responsiveslides.com v1.53 by @viljamis */
(function(c,I,B){c.fn.responsiveSlides=function(l){var a=c.extend({auto:!0,speed:500,timeout:4E3,pager:!1,nav:!1,random:!1,pause:!1,pauseControls:!0,prevText:"Previous",nextText:"Next",maxwidth:"",navContainer:"",manualControls:"",namespace:"rslides",before:c.noop,after:c.noop},l);return this.each(function(){B++;var f=c(this),s,r,t,m,p,q,n=0,e=f.children(),C=e.size(),h=parseFloat(a.speed),D=parseFloat(a.timeout),u=parseFloat(a.maxwidth),g=a.namespace,d=g+B,E=g+"_nav "+d+"_nav",v=g+"_here",j=d+"_on",
-w=d+"_s",k=c(""),x={"float":"left",position:"relative",opacity:1,zIndex:2},y={"float":"none",position:"absolute",opacity:0,zIndex:1},F=function(){var b=(document.body||document.documentElement).style,a="transition";if("string"===typeof b[a])return!0;s=["Moz","Webkit","Khtml","O","ms"];var a=a.charAt(0).toUpperCase()+a.substr(1),c;for(c=0;c"),x={"float":"left",position:"relative",opacity:1,zIndex:2},y={"float":"none",position:"absolute",opacity:0,zIndex:1},F=function(){var b=(document.body||document.documentElement).style,a="transition";if("string"===typeof b[a])return!0;s=["Moz","Webkit","Khtml","O","ms"];var a=a.charAt(0).toUpperCase()+a.substr(1),c;for(c=0;c"+a+""});k.append(A);l.navContainer?c(a.navContainer).append(k):f.after(k)}a.manualControls&&(k=c(a.manualControls),k.addClass(g+"_tabs "+d+"_tabs"));(a.pager||a.manualControls)&&k.find("li").each(function(a){c(this).addClass(w+(a+1))});if(a.pager||a.manualControls)q=
k.find("a"),r=function(a){q.closest("li").removeClass(v).eq(a).addClass(v)};a.auto&&(t=function(){p=setInterval(function(){e.stop(!0,!0);var b=n+1"+a.prevText+""+a.nextText+"";l.navContainer?c(a.navContainer).append(g):f.after(g);var d=c("."+d+"_nav"),G=d.filter(".prev");d.bind("click",function(b){b.preventDefault();b=c("."+j);if(!b.queue("fx").length){var d=e.index(b);b=d-1;d=d+1