Created
June 23, 2012 18:18
-
-
Save alexanmtz/2979283 to your computer and use it in GitHub Desktop.
Sliding options example
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
$(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