WordPress.org

Ready to get started?Download WordPress

Forums

WP UI - Tabs, Accordions, Sliders
[resolved] close first tab by default (10 posts)

  1. dsg257
    Member
    Posted 1 year ago #

    hi got the following code from another post by the author Kevin

    <script type="text/javascript">
    jQuery(function() {  jQuery('.ui-tabs').tabs({ collapsible : true, selected : -1  });
    </script>

    using the weaver pro theme in the admin there is a bit to insert scripts that load right before the header closes

    but the page dose not show the tabs closed by default always first 1 open

    any help would be great

    http://wordpress.org/extend/plugins/wp-ui/

  2. jshels
    Member
    Posted 1 year ago #

    There is a setting under Effects 'Enable all panels in a tabset to be collapsed.' that used to work but doesn't seem to work in the newest version.

  3. dsg257
    Member
    Posted 1 year ago #

    it leaves the first tab open you have to click the tab to collapse it but it works but not by default

  4. dsg257
    Member
    Posted 1 year ago #

    found the Solution
    you need to edit the tabs.js
    it is in the following path wp-ui\js\select
    line 132

    if (this.o.collapsibleTabs) {
                    options.collapsible = true;
             }

    insert the following
    options.selected = -1;

    you will then have

    if (this.o.collapsibleTabs) {
                    options.collapsible = true;
                    options.selected = -1;
                }

    Works and all tabs are now closed by default

    Hope it helps

  5. shipwreckgeorge
    Member
    Posted 1 year ago #

    WP UI ver. 0.8.7

    thanks for your suggestion dsg257!
    but unfortunately it did not work for me.
    any suggestions?

    also,
    is there a way to apply collapsible to specific tab sets?
    for example as a shortcode: style="xxxx" ~ collapsible="true"

  6. dsg257
    Member
    Posted 1 year ago #

    I use the following which works
    [wpspoiler style="wpui-arch" name="Royal Arch"] [wptabs][wptabtitle]Mark Master [/wptabtitle] [wptabcontent]

    then your content and [/wptabs][/wpspoiler]
    that works for me and they collapse
    see it in action here
    Tabs collapsible too

  7. dsg257
    Member
    Posted 1 year ago #

    remember to set the tabs and accordions to collapse in the qp-ui admin area under general and effects

  8. shipwreckgeorge
    Member
    Posted 1 year ago #

    Hi dsg257

    Looks like your wrapping tabs in a spoiler, which is hiding the tabs.
    I'm looking to have 3 tabs displayed inline but hide their content on load,
    not hide the tabs...

  9. dsg257
    Member
    Posted 1 year ago #

    just set the tabs to collapsible in the admin area be sure to test with different settings checked to see if it works might be a different version of javascript I usually start with everything unticked then tick what I want then 1 by 1 till I get the correct settings

  10. shipwreckgeorge
    Member
    Posted 1 year ago #

    Have the tabs closed checked off from the get go,
    tried different settings in the advanced (JS, Jquery, etc.)
    no avail...

    I'm able to click on the tabs and open and close the content just fine...
    just want the damn tabs content to be hidden on load already haha

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic