0

I've got a callback function written for the onbeforechange method. Below is the code:

introJs().onbeforechange(function() {
    if($(this).is(":visible") != true)
        if($(this).is("ui-tabs-panel") == true)
            $('.ui-tabs-nav a[href$="' + $(this).attr('id') + '"]').click();
        else
            $(this).show();
}).start();

The logic is correct (tested without calling introJs().start()) however, this callback function still doesn't get called before the next step. Any ideas?

Brandon
  • 103
  • 1
  • 5
  • 11
  • Btw, I've updated my intro.js file manually with the fix for onbeforechange (wasn't getting the correct element to call the function on) – Brandon Jun 20 '13 at 13:52

1 Answers1

5

Change position start()

introJs().onbeforechange(function(targetElementId) {  
    alert("after new step");
    switch($(targetElementId).attr("data-step")) {
        case "1": doSomething1(); break;
        case "2": doSomething2(); break;
        case "3": doSomething3(); break;

    }
}).start();
Community
  • 1
  • 1
peter.karakas
  • 141
  • 2
  • 6