Skip to content

Commit

Permalink
added scriptable API to page transitions
Browse files Browse the repository at this point in the history
  • Loading branch information
yawetse committed Oct 24, 2013
1 parent aa16be4 commit 0ef3582
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions js/pagetransitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ var PageTransitions = (function() {

}

function nextPage( animation ) {
function nextPage(options ) {
var animation = (options.animation) ? options.animation : options;

if( isAnimating ) {
return false;
Expand All @@ -60,11 +61,21 @@ var PageTransitions = (function() {

var $currPage = $pages.eq( current );

if( current < pagesCount - 1 ) {
++current;
if(options.showPage){
if( options.showPage < pagesCount - 1 ) {
current = options.showPage;
}
else {
current = 0;
}
}
else {
current = 0;
else{
if( current < pagesCount - 1 ) {
++current;
}
else {
current = 0;
}
}

var $nextPage = $pages.eq( current ).addClass( 'pt-page-current' ),
Expand Down Expand Up @@ -379,6 +390,9 @@ var PageTransitions = (function() {

init();

return { init : init };
return {
init : init,
nextPage : nextPage,
};

})();

0 comments on commit 0ef3582

Please sign in to comment.