• wombelt

    (@wombelt)


    Hi there,

    Like the Title says: I would like to open the (for example) third accordion opened by default.

    I have tried to put the “ui-state-active” class to a the h3 tag, like this:
    $(‘.wp-tab-title’).addClass(‘ui-state-active’);

    But the single accordion Titles have no different names.
    How can I select the third one (and open it)?

    https://wordpress.org/plugins/wp-ui/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter wombelt

    (@wombelt)

    ok next i#ve tried this:

    `$(‘.wp-tab-title’).addClass(‘ui-state-active’);
    $(“.wp-tab-title”).attr(‘aria-expanded’, ‘true’);
    $(“.wp-tab-title”).attr(‘aria-selected’, ‘true’);`
    but it does not work.

    How can i identify the separate tabs (h3 or whatever?)

    Thread Starter wombelt

    (@wombelt)

    Now I have found this page:

    A example to set “active” to last-child, with this code:

    $(function() {
            var index = 0;
            $(document).ready(function(){
                index = $("#accordion h3").length - 1;
            });
            $("#accordion").accordion({active:index});
        });

    How must I Modify that for the wp-ui plugin?
    In my case i would like to open the last child too.

    Thread Starter wombelt

    (@wombelt)

    bump

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘start with third accordion tab opened’ is closed to new replies.