Jump to content

Accordian Title Change When Expanded

Recommended Posts

https://grouper-azalea-byr2.squarespace.com/

password: Lara 

This might be a little far fetched, but I was wondering if there is anyway to change the title to my accordion dropdown when it's expanded?  I'm trying to be clever and create a "read more" button using the accordion feature, which so far looks really great! However, when the "read more" is expanded, it continues to say "read more" (obviously). I would love it to say "Read less" when expanded. Any help?

Link to comment
  • Replies 6
  • Views 177
  • Created
  • Last Reply

Top Posters In This Topic

On 4/19/2023 at 3:58 PM, kaydotjpg said:

I was wondering if there is anyway to change the title to my accordion dropdown when it's expanded?  when the "read more" is expanded...I would love it to say "Read less" 

Yes, you can do this with code.

The accordion title element has an aria-expanded attribute that is set to indicate whether the control is expanded or collapsed, allowing code to be written that will change the title when it expands/collapses.

The code will need to be written according to the way that you want it to work. For example, whether you want to affect every accordion title on the site, or just some.

About me: I'm Paul, a SQSP user for over 18 yrs and a Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥.
Work: Founder of SF.DIGITAL, providing high quality original extensions to supercharge your Squarespace website. 
Content: Views and opinions are my own. Links in my posts may refer to my own SF.DIGITAL products or may be affiliate links.
Forum advice is completely free. You can thank me by selecting a feedback emoji below. Buying a coffee is optional.

Book paid help with domains: Connect a GoDaddy domain. Connect a Squarespace Domain. Domain assistance

Link to comment

@paul2009 Hi, thanks so much for explaining that. For this particular situation, I would like this text change once expanded only on one particular accordion. When collapsed it says "READ MORE" and once expanded I would like it to read "READ LESS". Can you help me with this code? The block ID for this accordion is: 

#block-yui_3_17_2_1_1681517195512_6004

Link to comment

Hopefully my earlier hint gives others the opportunity to chime in.

About me: I'm Paul, a SQSP user for over 18 yrs and a Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥.
Work: Founder of SF.DIGITAL, providing high quality original extensions to supercharge your Squarespace website. 
Content: Views and opinions are my own. Links in my posts may refer to my own SF.DIGITAL products or may be affiliate links.
Forum advice is completely free. You can thank me by selecting a feedback emoji below. Buying a coffee is optional.

Book paid help with domains: Connect a GoDaddy domain. Connect a Squarespace Domain. Domain assistance

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • 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.