Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On Transition Hook Function #203

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions js/bjqs-1.3.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@

// presentational options
usecaptions : true, // enable/disable captions using img title attribute
randomstart : false, // start from a random slide
responsive : false // enable responsive behaviour
randomstart : false, // start from a random slide
responsive : false, // enable responsive behaviour
ongo : undefined // a hook function that will be executed upon transition

};

Expand Down Expand Up @@ -615,7 +616,6 @@
};

var go = function(direction, position) {

// only if we're not already doing things
if(!state.animating){

Expand Down Expand Up @@ -648,6 +648,10 @@
state.currentslide = state.nextslide;
state.currentindex = state.nextindex;

// execute a hook function
if(typeof(settings.ongo) === "function") {
settings.ongo();
}
});

}
Expand Down Expand Up @@ -702,7 +706,11 @@
}

state.animating = false;


// execute a hook function
if(typeof(settings.ongo) === "function") {
settings.ongo();
}
});

}
Expand Down