Skip to content

Commit

Permalink
You can now pass a callback in as an option and it will get called on…
Browse files Browse the repository at this point in the history
… change with the current slide index as a parameter
  • Loading branch information
Damian Moore committed Oct 11, 2012
1 parent 086ee6d commit 0c78b0d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion jquery.touchslider.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 0c78b0d

Please sign in to comment.