【问题标题】:jQuery UI Accordion will not reopen after closejQuery UI Accordion 关闭后不会重新打开
【发布时间】:2013-05-27 08:45:39
【问题描述】:

我在 jQuery UI Accordion 中有一个表单。

使用此代码,访问者必须验证第一个面板,然后才能打开下一个手风琴面板。但是,如果访问者想要返回第一个面板,它不会放手。

$(document).ready(function () {

    $("#accordion").accordion({ event: false });

    $('#openfirst').click(function () {

        if (varification is okay then) {

            $("#accordion").accordion({ active: 1 });

                // cancel submit
                return false;

            } else {

                alert('Please acknowledge the following before proceeding.');

            }

        });

        $('#opensecond').click(function () {


            if (varification is okay then) {

                $("#accordion").accordion({ active: 2 });

            } else {

                alert('Please acknowledge the following before proceeding.');

            }

        });

        $('#openthird').click(function () {

            if (varification is okay then) {

                $("#accordion").accordion({ active: 3 });

                // cancel submit
                return false;

            } else {

                alert('Please acknowledge the following before proceeding.');

            }

        });

    });
</script>

【问题讨论】:

  • 有人能帮忙吗..!!!????

标签: jquery-ui jquery-ui-accordion jquery


【解决方案1】:

而不是使用

$("#accordion").accordion({ event: false });

尝试使用

$( ".selector" ).accordion( "disable" );

在用户验证后,使用

$( ".selector" ).accordion( "enable" ); //for manual operation of tabs

$( ".selector" ).accordion({ active: # }); //for code generated operation of tabs

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2010-09-27
    • 2017-08-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-09-26
    • 2013-01-03
    • 1970-01-01
    相关资源
    最近更新 更多