Skip to content

Instantly share code, notes, and snippets.

@netconstructor
Forked from imakewebthings/gist:1216527
Last active August 29, 2015 14:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save netconstructor/3ad38672b9eff950a420 to your computer and use it in GitHub Desktop.
Save netconstructor/3ad38672b9eff950a420 to your computer and use it in GitHub Desktop.
(function($, deck, undefined) {
$(document).bind('deck.change', function(e, from, to) {
var $prev = $[deck]('getSlide', to-1),
$next = $[deck]('getSlide', to+1);
$[deck]('getSlide', to).trigger('deck.becameCurrent');
$prev && $prev.trigger('deck.becamePrevious');
$next && $next.trigger('deck.becameNext');
});
})(jQuery, 'deck');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment