juven14 / Collapsible

No longer maintaining - Manage multiple collapsibles with cookie support
Other
70 stars 64 forks source link

defaultOpen State #9

Closed philipschilling closed 11 years ago

philipschilling commented 11 years ago

Hello,

Is it possible to load all collapsibles in open state without needing to define each ID in an array? Is it possible to use just a class for all collapsibles which shall be opened by default or to load by default all collapsibles open rather than closed?

Thanks,

Philip

juven14 commented 11 years ago

You can just set the loadClose to show in the config and leave the cookie blank for defaultOpen to get them all to opened the first time its created.

loadClose: function (elem, opts) { //replace the default close state with custom function
    elem.next().show();
}
philipschilling commented 11 years ago

Many thanks! I tried it already but when I made a change, e.g. closed a tab, and reloaded the page, the closed state is not remembered.

I also need to click twice on the tabs to close them and even though they are initially open, they have the close state with class collapse-close and not open state with class collapse-open.