Jump to content

Expandable text sections in Avenue, like in Wikipedia mobile?

Recommended Posts

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
  • Replies 5
  • Views 5.9k
  • Created
  • Last Reply

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

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

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

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

Archived

This topic is now archived and is closed to further replies.

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.