Created
December 14, 2012 02:31
-
-
Save ahsquared/4282065 to your computer and use it in GitHub Desktop.
jQuery tools scrollable doesn't handle scrolling one at a time but showing multiples, this fixes that.
This file contains hidden or 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
$('#divMonthsOuter .scrollable').scrollable({ | |
circular: false, | |
onSeek: function (event, index) { | |
var next = this.getRoot().siblings('.next'); | |
// the 6 here is the number of items showing | |
if (this.getIndex() >= this.getSize() - 6) { | |
// Disable the Next link | |
next.addClass('disabled'); | |
} else { | |
next.removeClass('disabled'); | |
} | |
}, | |
onBeforeSeek: function (event, index) { | |
var newIndex = this.getIndex(); | |
// the 6 here is the number of items showing | |
if (this.getIndex() >= this.getSize() - 6) { | |
if (index > newIndex) { | |
return false; | |
} | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment