Forum:Collapsing text via button

Is it possible to have text collapse like this:, where clicking   reveals the text   and clicking "hidden content" (inside brackets) hides the text again? I'd like to keep all this on one line, so Help:Collapsing doesn't really offer me that much insight into this topic. -- 13:06, October 4, 2012 (UTC)

You can do this:
 * This text is not collapsible; but the next is collapsible and hidden by default: This text should be hidden by default. This text should be visible as well.

Or this:
 * This text is not collapsible; but the next is collapsible and hidden by default: [Toggle Content] This text should be hidden by default. This text should be visible as well.

As far as exactly what you're trying to accomplish, I don't think you can coerce mw-collapsible to do it, you'll need a custom JS solution. This is pretty rudimentary so isn't hard to do. Shove the above in your MediaWiki:Common.js. Then stick the following in your MediaWiki:Common.css/MediaWiki:Wikia.css: And finally, create a template with the following code:  You can now use this feature like this: Some text blah blah blah blah blah, more text, whatever.

[Foot note: If the user has JavaScript disabled then the hidden text will display by default, you can alter the logic so that its hidden by default instead if you want] Lunarity 14:35, October 4, 2012 (UTC)


 * Works like a dream aka more than perfectly :D -- 15:03, October 4, 2012 (UTC)