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

showStep's stepIndex contains previous index #103

Closed
MartinP7r opened this issue Aug 27, 2020 · 3 comments
Closed

showStep's stepIndex contains previous index #103

MartinP7r opened this issue Aug 27, 2020 · 3 comments
Labels

Comments

@MartinP7r
Copy link

I'm on the latest version 5.1.1

http://techlaboratory.net/jquery-smartwizard#event-showstep

$("#smartwizard").on("showStep", function(e, anchorObject, stepIndex, stepDirection) {
   console.log("You are on step "+stepIndex+" now");
});

somehow this example is displaying the index of the previous step, not the current. E.g. when the event is trigger after moving from index 0 to 3, it displays 0.

@bkeroackdsc
Copy link

Here's a really hacky way to get the current step from the browser location:

let currentstep = parseInt(window.location.href.substring(window.location.href.indexOf("#")+1).replace("step-", ""), 10)-1;

@marchantm
Copy link

Here's a really hacky way to get the current step from the browser location:

let currentstep = parseInt(window.location.href.substring(window.location.href.indexOf("#")+1).replace("step-", ""), 10)-1;

Thanks!!!!!!!

@techlab
Copy link
Owner

techlab commented Jun 26, 2022

Fixed the issue on v6. Please see https://github.com/techlab/jquery-smartwizard/releases/tag/v6.0.1
Demo: http://techlaboratory.net/projects/demo/jquery-smart-wizard/v6/#step-1

Thank you @MartinP7r

@techlab techlab closed this as completed Jun 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants