Closed shafqatevo closed 10 years ago
How do you mean randomly?
I tested the following and quickly clicked the pagination to try and throw it off but it returned the currentFrameId
correctly.
var sequence = $("#sequence").sequence(options).data("sequence");
sequence.beforeNextFrameAnimatesIn = function() {
console.log(sequence.currentFrameId);
}
Hi Ian,
By randomly, I mean when user is navigating the slides manually, not necessarily in order, like going from slide 4 to slide 2, or slide 3 to slide 1.
Basically we're trying to use the current FrameID to match with first frame where we need to disable the previous and next navigation buttons and the last frame where we need to disable next navigation button.
Is there any other direct way of doing that?
Thanks! Shafqat On Apr 25, 2014 12:14 AM, "Ian Lunn" notifications@github.com wrote:
How do you mean randomly?
I tested the following and quickly clicked the pagination to try and throw it off but it returned the currentFrameId correctly.
var sequence = $("#sequence").sequence(options).data("sequence");
sequence.beforeNextFrameAnimatesIn = function() { console.log(sequence.currentFrameId); }
— Reply to this email directly or view it on GitHubhttps://github.com/IanLunn/Sequence/issues/240#issuecomment-41313511 .
Try this:
var sequence = $("#sequence").sequence(options).data("sequence");
sequence.beforeNextFrameAnimatesIn = function() {
if(sequence.nextFrameID === 1) {
hidePrevious();
}
if(sequence.nextFrameID === sequence.numberOfFrames) {
hideNext();
}
}
Thanks, Ian, that worked nicely!
We had not considered to use nextFrameID. We were thinking we would need something like beforeCurrentFrameAnimatesIn and check for currentFrameID.
Hi Ian,
We're also experiencing this issue that currentFrameID isn't correct most of the time when user is navigating to any slide randomly.
Can you please confirm or tell us any workaround to make it work?