Jump to content

Change accordion layout from vertical to horizontal (depending on screen size)

Go to solution Solved by Ziggy,

Recommended Posts

Squarespace accordion only allows vertical layout, no matter the screen size.

I was wondering if it's possible to change the accordion layout to horizontal on wider screens (e.g. desktops).

Here's what I'm trying to achieve:

For mobile screens:

Screenshot2024-09-13at04_16_36.thumb.png.5338ed9923d8dbd28f21cd7e8cb52512.png

 

For desktop screens:

Screenshot2024-09-13at04_17_36.thumb.png.5de5c154469c89a35858e58dff9489c6.png

 

 

Edited by abc
Link to comment
7 hours ago, abc said:

For desktop screens:

You would simply need two accordion blocks.

Please like and upvote if my comments were helpful to you. Cheers!

Zygmunt Spray
Squarespace Website Designer
Contact me: 
https://squarefortytwo.com 
Hire me on Upwork!

🔌 Ghost Squarespace Plugins (Referral link)
📈 SEO Space (Referral link)
 SquareWebsites Plugins (Referral link)
 🔲 SQSP Themes (Referral link) 
Spark Plugin (Referral link) 
 🖼️ Pinch-to-Zoom Gallery Lightbox Plugin (Referral link) 

 Did I help? Buy me a coffee?

Link to comment
11 minutes ago, Ziggy said:

You would simply need two accordion blocks.

Tried that before. It's not perfect. Two separate accordions do not communicate with each other, in other words, one does not collapse when another opens, etc.

Is there no way to display accordion titles in a row instead of a column?

Link to comment

Try this Custom CSS:

@media only screen and (min-width:940px) {
  .sqs-block-accordion .accordion-items-container {
    columns: 2;
    -webkit-columns: 2;
    -moz-columns: 2;
  }
}

Please like and upvote if my comments were helpful to you. Cheers!

Zygmunt Spray
Squarespace Website Designer
Contact me: 
https://squarefortytwo.com 
Hire me on Upwork!

🔌 Ghost Squarespace Plugins (Referral link)
📈 SEO Space (Referral link)
 SquareWebsites Plugins (Referral link)
 🔲 SQSP Themes (Referral link) 
Spark Plugin (Referral link) 
 🖼️ Pinch-to-Zoom Gallery Lightbox Plugin (Referral link) 

 Did I help? Buy me a coffee?

Link to comment
1 hour ago, Ziggy said:

Try this Custom CSS:

@media only screen and (min-width:940px) {
  .sqs-block-accordion .accordion-items-container {
    columns: 2;
    -webkit-columns: 2;
    -moz-columns: 2;
  }
}

Right, it split it into two columns, but everything else is messed up. I don't think I have the energy or the expertise to fix it. Been working on my main product list for the last 72 hours. Thanks anyway.

Link to comment
44 minutes ago, abc said:

but everything else is messed up

In what way?

Please like and upvote if my comments were helpful to you. Cheers!

Zygmunt Spray
Squarespace Website Designer
Contact me: 
https://squarefortytwo.com 
Hire me on Upwork!

🔌 Ghost Squarespace Plugins (Referral link)
📈 SEO Space (Referral link)
 SquareWebsites Plugins (Referral link)
 🔲 SQSP Themes (Referral link) 
Spark Plugin (Referral link) 
 🖼️ Pinch-to-Zoom Gallery Lightbox Plugin (Referral link) 

 Did I help? Buy me a coffee?

Link to comment
  • Solution
21 minutes ago, abc said:

Notice how when you expand the first dropdown, it affects the second one because categories in the first dropdown can't all fit inside its container. In its current state, it would need a lot of fixing.

This would be a different approach:

@media only screen and (min-width: 940px) {
  .sqs-block-accordion .accordion-items-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
  }
  .sqs-block-accordion .accordion-item {
    width: 50%;
  }
}

 

Please like and upvote if my comments were helpful to you. Cheers!

Zygmunt Spray
Squarespace Website Designer
Contact me: 
https://squarefortytwo.com 
Hire me on Upwork!

🔌 Ghost Squarespace Plugins (Referral link)
📈 SEO Space (Referral link)
 SquareWebsites Plugins (Referral link)
 🔲 SQSP Themes (Referral link) 
Spark Plugin (Referral link) 
 🖼️ Pinch-to-Zoom Gallery Lightbox Plugin (Referral link) 

 Did I help? Buy me a coffee?

Link to comment
4 hours ago, Ziggy said:

This would be a different approach:

@media only screen and (min-width: 940px) {
  .sqs-block-accordion .accordion-items-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
  }
  .sqs-block-accordion .accordion-item {
    width: 50%;
  }
}

 

Perfect! Thank you so much!

Link to comment
4 hours ago, abc said:

Perfect! Thank you so much!

Brill

Please like and upvote if my comments were helpful to you. Cheers!

Zygmunt Spray
Squarespace Website Designer
Contact me: 
https://squarefortytwo.com 
Hire me on Upwork!

🔌 Ghost Squarespace Plugins (Referral link)
📈 SEO Space (Referral link)
 SquareWebsites Plugins (Referral link)
 🔲 SQSP Themes (Referral link) 
Spark Plugin (Referral link) 
 🖼️ Pinch-to-Zoom Gallery Lightbox Plugin (Referral link) 

 Did I help? Buy me a coffee?

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.