Skip to content

Instantly share code, notes, and snippets.

@alexanmtz
Created June 23, 2012 18:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexanmtz/2979283 to your computer and use it in GitHub Desktop.
Save alexanmtz/2979283 to your computer and use it in GitHub Desktop.
Sliding options example
$(function(){
$('.live-pagination').hide();
$('.custom-init').submit(function(e){
var items = $('.option-item').val();
var autoHeight = $('.option-autoHeight').val();
var currentPage = $('.option-currentPage').val();
var element = $('.slide-live-example').sliding({
next: '.live-next',
prev: '.live-previous',
items: items,
autoHeight: parseInt(autoHeight),
navClicked: function(el, currentPage) {
$('.current-page').html(element.sliding('getCurrentPage'));
}
});
$('.current-page').html(element.sliding('getCurrentPage'));
element.sliding('goToPage', parseInt(currentPage));
element.sliding('setTotalPages', Math.floor(18/5));
$('.total-pages').html(element.sliding('getTotalPages'));
$(this).find('input:submit').attr('disabled', 'disabled');
$('.live-pagination').show();
return false;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment