【问题标题】:JQuery-Steps: How to customize the next button for each step?JQuery-Steps:如何为每个步骤自定义下一步按钮?
【发布时间】:2014-07-29 22:40:02
【问题描述】:

我正在使用 JQuery Steps,效果很好。但我无法弄清楚如何更改“下一步”按钮上的文本,以便每个步骤都不同。有没有办法做到这一点,也许在 onStepChanged 方法中?

【问题讨论】:

    标签: jquery-steps


    【解决方案1】:

    这是你的答案哥们:

    $(function ()
    {
        var settings = {
            headerTag: "h2",
            bodyTag: "section",
            transitionEffect: "slideLeft",
                labels: 
                {
                   next: "Enroll",
                   finish: "Pay Now",
                },
            onStepChanged: function (event, currentIndex, newIndex)
                {       
                    //change color of the Go button
                    //alert(currentIndex);
                    if(currentIndex==1){
                    $(".actions a:eq(1)").text("Checkout");
                    }else{
                        $(".actions a:eq(1)").text("Enroll");
                    }
    
                },
    
        };
        $("#wizard").steps(settings);
    });
    

    【讨论】:

      【解决方案2】:

      onStepChanged 是更改下一步 按钮文本的正确位置。不幸的是,目前没有很好的方法来做这种事情。只需使用如下选择器搜索 Next 按钮,然后更改文本 wizard.find(".actions a:eq(1)").text("Next One")。在 2.0.0 版本中将是执行此类操作的更好方法。

      【讨论】:

        猜你喜欢
        • 2013-11-26
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-01-10
        • 1970-01-01
        相关资源
        最近更新 更多