From 0c78b0d6a3fecf8e2f1227be84e69937e6fa4df0 Mon Sep 17 00:00:00 2001 From: Damian Moore Date: Thu, 11 Oct 2012 16:28:39 +0100 Subject: [PATCH] You can now pass a callback in as an option and it will get called on change with the current slide index as a parameter --- jquery.touchslider.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jquery.touchslider.js b/jquery.touchslider.js index 1333e42..cdf49a3 100644 --- a/jquery.touchslider.js +++ b/jquery.touchslider.js @@ -29,7 +29,8 @@ http://touchslider.com pagination: "." + namespace + "-nav-item", currentClass: namespace + "-nav-item-current", duration: 350, - mouseTouch: true + mouseTouch: true, + callback: function() {} // [container, scroller] }, options); @@ -399,6 +400,7 @@ http://touchslider.com function changedView(index) { pagination.removeClass(options.currentClass) .eq(index).addClass(options.currentClass); + options.callback.call(this, index); } // set item or next