Guest Posted October 16, 2015 Share Posted October 16, 2015 Hello everyone. In Avenue, we are looking for a way to allow readers to expand sections of text by clicking on headings or subheadings. The mobile version of Wikipedia offers a perfect illustration of this functionality: when you click on a heading, the body text appears. Click the heading again and the body text hides. On Wikipedia mobile, those headings look like this when the body text is hidden ? Heading and like this when the body text is displayed ? Heading. Thank you! Link to comment
alxfyv Posted October 16, 2015 Share Posted October 16, 2015 The question has been asked before and a good answer with explanations given. How can I create accordion style hide/show blocks of text?. For the source article cited in that question, see Sandeep's Nook: JavaScript Page Another question here that had a different solution is Five: Making FAQ page accordion style?. This one uses markdown blocks and some script provided by @silvabokis; see his site at silvabokis.com. Another solution, this one to hide/show not just text but graphics also, is at How do I create hide/show section of an entire page of text, images and or galleries in Squarespace (spoiler function/accordian/collapse)?. Perhaps the earliest answer on this forum to this question is again by @silvabokis in the thread How do I create hide/show text on a page, like you see with FAQs?. There is good discussion by and contributions from others. See also How to tweak this code for hide/show text toggle?. I'm a retired attorney who was asked by a friend to build a website. In a prior lifetime, in a galaxy far, far away and long, long ago, I was a computer systems analyst / programmer. I'm a novice autodidact in CSS, JavaScript and HTML learning in part by example.. I've asked questions on this forum and been lucky enough to have others help me, so I'm inclined to answer any question I can. Pay it forward. Link to comment
alxfyv Posted October 17, 2015 Share Posted October 17, 2015 I amended the answer to include further results from further research. I'm a retired attorney who was asked by a friend to build a website. In a prior lifetime, in a galaxy far, far away and long, long ago, I was a computer systems analyst / programmer. I'm a novice autodidact in CSS, JavaScript and HTML learning in part by example.. I've asked questions on this forum and been lucky enough to have others help me, so I'm inclined to answer any question I can. Pay it forward. Link to comment
Guest Posted October 21, 2015 Share Posted October 21, 2015 Thank you very much for this answer! Link to comment
Guest Posted October 21, 2015 Share Posted October 21, 2015 Oops, I see the special characters did not display in my question. Instead of the question marks (? Heading), there should be an arrow pointing up and and arrow pointing down. Link to comment
alxfyv Posted October 22, 2015 Share Posted October 22, 2015 You're quite welcome. Do me a favor please and accept the answer and vote it up. I'm a retired attorney who was asked by a friend to build a website. In a prior lifetime, in a galaxy far, far away and long, long ago, I was a computer systems analyst / programmer. I'm a novice autodidact in CSS, JavaScript and HTML learning in part by example.. I've asked questions on this forum and been lucky enough to have others help me, so I'm inclined to answer any question I can. Pay it forward. Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.