5

I'm trying to hide or show a section in a question I posted on Stack Overflow, similarly to how you can expand a section in the advanced help section (see image). enter image description here

I've tried to figure this out on my own. However, every search on hiding and displaying returns something on hiding or displaying HTML elements. The same is true for expanding/contracting and every other synonym I could think of. I went through the two pages of top rated questions (presuming they would be the longest and have sections that could be hidden or displayed) in the hopes of finding a post that did it, so I could look in the edit section and see the code they used, but I couldn't find an example. Could someone please let me know how this is done (and hopefully this will be of some use to a future user).

2

1 Answer 1

4

This is not possible in user posts.

The closest you could get to reproducing this would be to use a code snippet to write your own collapsible menu system. However, you would have to develop the code required for this, it would look a bit messy, and code snippets are only avaliable on select sites.


But why do you need to do this in the first place?

  • Long posts are absolutely fine. There isn't any need to collapse them down. However, it would be a good idea to separate your paragraphs using the heading syntax: #, ##, ###
  • Are you trying to use these collapsible sections as a spoiler field? You can use the spoiler syntax for that: >!

You can't see this until you hover!

4
  • Thanks for the answer. I must have been mistaken on where I saw it. Thanks for the info. Commented Mar 18, 2017 at 3:38
  • @EricWiener To add to angussidney's answer: please be aware that spoilers are inaccessible to keyboard users.
    – Tsundoku
    Commented Oct 8, 2018 at 9:42
  • You say it is not necessary but I would find "folding" to be useful when editting latex in a long post (on SE Math) so that I can arrange to see the input window and the formatted text at the same time. This would avoid the hassle of having to scroll down constantly to check the output looks right. (It would also be nice to restrict the latex conversion to a small zone to stop delays but that is another issue).
    – steveOw
    Commented Aug 12, 2019 at 19:33
  • Why: Because I want to include large, vertical, images
    – Newbyte
    Commented Apr 11 at 20:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .