Skip to content

Commit 0c78b0d

Browse files
author
Damian Moore
committed
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
1 parent 086ee6d commit 0c78b0d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

jquery.touchslider.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ http://touchslider.com
2929
pagination: "." + namespace + "-nav-item",
3030
currentClass: namespace + "-nav-item-current",
3131
duration: 350,
32-
mouseTouch: true
32+
mouseTouch: true,
33+
callback: function() {}
3334
// [container, scroller]
3435
}, options);
3536

@@ -399,6 +400,7 @@ http://touchslider.com
399400
function changedView(index) {
400401
pagination.removeClass(options.currentClass)
401402
.eq(index).addClass(options.currentClass);
403+
options.callback.call(this, index);
402404
}
403405

404406
// set item or next

0 commit comments

Comments
 (0)