Created
November 20, 2012 16:06
-
-
Save nicinabox/4118841 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Augment the api with size | |
$.fn.superslides.api.size = $("." + $.fn.superslides.options.container_class).children().length; | |
$(document).on('slides.animated', function(e, current, next, prev) { | |
var size = $.fn.superslides.api.size; | |
// Fix for next bug | |
next = next + 1; | |
if (current === 0) { | |
console.log('first slide'); | |
} | |
if (next === size) { | |
console.log('last slide'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Great solution and thanks for taking the time. Just fyi i'm using this logic to show/hide navigation arrows as appropriate (which could be useful for others):
// Augment the api with size so we can get the number of slides
$.fn.superslides.api.size = $ ("." + $.fn.superslides.options.container_class).children().length;