Skip to content
This repository has been archived by the owner on Feb 17, 2021. It is now read-only.

Multipage + previous button = skip ahead, not backward #4

Closed
tilomba opened this issue Jun 21, 2013 · 4 comments
Closed

Multipage + previous button = skip ahead, not backward #4

tilomba opened this issue Jun 21, 2013 · 4 comments

Comments

@tilomba
Copy link

tilomba commented Jun 21, 2013

Great code and I hope this project continues to be worked on.

Having an issue while going between pages on a tour and then going back to previous pages. I'm going to other pages by using the following (not sure if this is the right approach):

...
multipage: true,
onNext: function() {
document.location.href = 'index2.html';
}
...

This works as expected and I can continue to jump between pages going forward without any issue. Going backwards, however with the same logic, but in "onPrev()" sends me to the other page, but advances the steps. Therefore if step 1 = page 1, step 2 = page 2, step 3 = page 1, then when I click previous on step 2 (page 2) I am sent back to page 1, but it is now on step 3. It seems to have to do with the "multipage" variable being set.

Thanks again!
Michael

@gkoo
Copy link
Contributor

gkoo commented Jun 23, 2013

Hey Michael, I tried to reproduce the behavior you're describing but I'm having a hard time doing so. I created a sample page with a very basic demo tour page and it seems to be displaying the correct steps on each page. Take a look at that demo tour (js file here) and see if it matches up with what you're doing.

If you're still having trouble, can you possibly link me to a page where I can take a look at the tour you're trying to build, or paste in the code for your tour? Thanks!

@gkoo
Copy link
Contributor

gkoo commented Jun 23, 2013

Okay, never mind, I realize what I was missing -- the multipage option. It seems like the tour will work fine if you just omit the multipage option from your steps, so I'd recommend you do that.

I think the multipage option is a vestigial part of Hopscotch that may not even be needed anymore--I may possibly even remove it, but I need to look through and make sure that doing so won't break anything. Let me know if you encounter any more problems!

@gkoo
Copy link
Contributor

gkoo commented Jun 23, 2013

Hey Michael, so I took another look at the code and realized that the multipage option is actually necessary. I've made a small fix and I think it should work now. The example tour page I linked to in my previous comment uses the latest code and is working fine. Tour code here. Try it out and let me know if it works for you.

@gkoo gkoo closed this as completed Jun 23, 2013
@tilomba
Copy link
Author

tilomba commented Jun 24, 2013

Thanks Gordon! I appreciate all your work on this and on a weekend, too! This worked for me.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants