javascript - onbeforechange callback for intro.js - Stack Overflow

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

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?

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?

Share Improve this question asked Jun 20, 2013 at 13:47 BrandonBrandon 1031 gold badge5 silver badges11 bronze badges 1
  • 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 Commented Jun 20, 2013 at 13:52
Add a ment  | 

1 Answer 1

Reset to default 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();

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745206376a4616612.html

相关推荐

  • javascript - onbeforechange callback for intro.js - Stack Overflow

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

    10小时前
    40

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信