WordPress.org

Support

Support » Plugins and Hacks » [Resolved] close first tab by default

[Resolved] close first tab by default

  • 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/

Viewing 9 replies - 1 through 9 (of 9 total)
  • 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.

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

    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

    shipwreckgeorge
    Member

    @shipwreckgeorge

    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”

    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

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

    shipwreckgeorge
    Member

    @shipwreckgeorge

    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…

    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

    shipwreckgeorge
    Member

    @shipwreckgeorge

    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

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Resolved] close first tab by default’ is closed to new replies.