intro.js icon indicating copy to clipboard operation
intro.js copied to clipboard

No way to know which step is being performed,if some step not bind element

Open killergxm opened this issue 7 years ago • 3 comments

Description

the change() callback is just get the bind element.But if it not have element and I performed some rollback and forward operations,I would lose the step number.

killergxm avatar Nov 27 '19 12:11 killergxm

I second that. I would like to have a second parameter for introJs.onchange(), introJs.onbeforechange() and introJs.onafterchange() that takes the corresponding step data in case you used the json config method.

JohnArcher avatar Dec 03 '19 13:12 JohnArcher

You can get the current step number, and use that to get the original step data:

const intro = introJs({
   steps: [{
      intro: 'Hello World!',
      customData: {myCustomField: 'my custom value'}
   }]
});
const currentStepData = intro._options.steps[intro._currentStep];
console.log(currentStepData.customData);
// my custom value

LeshM avatar Jan 22 '20 09:01 LeshM

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Oct 13 '20 16:10 stale[bot]