4

My first steps points to a button which has to be clicked by the user, then after clicking the button a dialog where the user can fill in some details pop up.

what happens is i'm just getting the backdrop and the intro does not point to the dialog, since it started on load of the page when the dialog is not yet on the page...

Is there a way to do this? (backbone and introjs)

I am using backbone to render the dialog on click of the button

Norly Canarias
  • 1,736
  • 1
  • 21
  • 19

1 Answers1

0

I've never used intro.js, but looking at their documentation, it looks like they have methods for adding steps to your intro at times other than pageload. You should add the step involving your dialog in the render method of your backbone view, after the html is added to the page. (or you could handle all of your intro.js code there if you like).

So if your view does something like the following to render:

var myHtml = '<div class="dialog">Here is the dialog!</div>';
this.$el.html(myHtml)

then you should follow that with something like:

introjs().addStep({
    element: this.el,
    intro: 'Here is the starting dialog'
}).start();

If you define other introjs steps in other areas of the code, you will probably have to experiment a little to get your steps in the right order, but this should get you started.

taras
  • 6,566
  • 10
  • 39
  • 50
arbuthnott
  • 3,819
  • 2
  • 8
  • 21