usingmyhead Posted February 4, 2022 Share Posted February 4, 2022 I'm wondering if anyone has some code that will show an item from the Squarespace Accordion Block as open by default? I have checked the excellent thread by @tuanphan as well as others on the forum but couldn't find what I need. My client wants the first accordion item to be open when the page loads (then close/open as usual along with the others in the Accordion Block). Link to comment
paul2009 Posted February 4, 2022 Share Posted February 4, 2022 14 minutes ago, usingmyhead said: I'm wondering if anyone has some code that will show an item from the Squarespace Accordion Block as open by default? My client wants the first accordion item to be open when the page loads This is a built-in feature 🙂 usingmyhead 1 About: SQSP User for 17 yrs. Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥. Work: Founder of SF Digital, building Squarespace Extensions to supercharge your commerce website. Content: Links in my posts may refer to SF Digital products or may be affiliate links. If my advice helped, you can thank me by clicking one of the feedback emojis below. I love coffee too. Link to comment
usingmyhead Posted February 5, 2022 Author Share Posted February 5, 2022 Massive FACEPALM 🤣 paul2009 1 Link to comment
usingmyhead Posted February 5, 2022 Author Share Posted February 5, 2022 Just goes to show, you're never too experienced to learn something new (and never too proud to embarrass yourself on a public forum) 😜 Link to comment
paul2009 Posted February 5, 2022 Share Posted February 5, 2022 ...and never more shocked than me to discover that something is built in and doesn't require code 😲 usingmyhead, creedon and codeandtonic 3 About: SQSP User for 17 yrs. Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥. Work: Founder of SF Digital, building Squarespace Extensions to supercharge your commerce website. Content: Links in my posts may refer to SF Digital products or may be affiliate links. If my advice helped, you can thank me by clicking one of the feedback emojis below. I love coffee too. Link to comment
codeandtonic Posted February 5, 2022 Share Posted February 5, 2022 6 hours ago, paul2009 said: ...and never more shocked than me to discover that something is built in and doesn't require code 😲 I would have started coding without even checking for sure... 🤦♂️ usingmyhead and paul2009 2 Freelance Squarespace developer making plugins like Full-Width Blocks, Hover effects for grid gallery and the Darkmode plugin. I know Squarespace inside out and I'm able to solve pretty much any Squarespace code problem. Get in touch here! Link to comment
MayaViolet Posted March 22, 2022 Share Posted March 22, 2022 On 2/4/2022 at 10:06 AM, paul2009 said: This is a built-in feature 🙂 Any insight on how to set all accordion blocks to be opened at once? I understand it would most likely take some javascript... Attempting to have a list layout on Desktop with each section always open, but then make it more mobile friendly aka accordion-functioning on mobile. Any thoughts? Link to comment
tuanphan Posted March 24, 2022 Share Posted March 24, 2022 On 3/23/2022 at 4:39 AM, MayaViolet said: Any insight on how to set all accordion blocks to be opened at once? I understand it would most likely take some javascript... Attempting to have a list layout on Desktop with each section always open, but then make it more mobile friendly aka accordion-functioning on mobile. Any thoughts? Add to Design > Custom CSS /* Accordion Block - Expand all items */ .sqs-block-accordion .accordion-item__dropdown { display: block !important; } fred 1 Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care Link to comment
MayaViolet Posted March 24, 2022 Share Posted March 24, 2022 9 hours ago, tuanphan said: Add to Design > Custom CSS /* Accordion Block - Expand all items */ .sqs-block-accordion .accordion-item__dropdown { display: block !important; } Oop - much easier than I thought 🤪 Thank you! Link to comment
daniellenoakes Posted November 21 Share Posted November 21 On 3/24/2022 at 7:39 AM, tuanphan said: Add to Design > Custom CSS /* Accordion Block - Expand all items */ .sqs-block-accordion .accordion-item__dropdown { display: block !important; } how would we apply this to not all items, but say the 4th one? odd request i know! and is it possible to number the accordian list titles in a different font?! thank you so much this would be so helpful!!! Link to comment
tuanphan Posted November 24 Share Posted November 24 On 11/22/2023 at 12:12 AM, daniellenoakes said: how would we apply this to not all items, but say the 4th one? odd request i know! and is it possible to number the accordian list titles in a different font?! thank you so much this would be so helpful!!! #1. Use this /* Accordion Block - Expand all items */ .sqs-block-accordion li:nth-child(4) .accordion-item__dropdown { display: block !important; } #2. Each titles in each accordion will use a different font name or font color or? daniellenoakes 1 Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care Link to comment
daniellenoakes Posted Friday at 11:14 AM Share Posted Friday at 11:14 AM On 11/24/2023 at 3:30 AM, tuanphan said: #1. Use this /* Accordion Block - Expand all items */ .sqs-block-accordion li:nth-child(4) .accordion-item__dropdown { display: block !important; } #2. Each titles in each accordion will use a different font name or font color or? i'm trying to change the numbers to be a different font, here's my attempt: #block-yui_3_17_2_1_1700055594134_17636 .accordion-item__title h4 strong * {font-family: 'montserrat'!important; font-size:08.em!important; letter-spacing:0.2em!important;} Link to comment
tuanphan Posted Friday at 11:48 AM Share Posted Friday at 11:48 AM 33 minutes ago, daniellenoakes said: i'm trying to change the numbers to be a different font, here's my attempt: #block-yui_3_17_2_1_1700055594134_17636 .accordion-item__title h4 strong * {font-family: 'montserrat'!important; font-size:08.em!important; letter-spacing:0.2em!important;} Use strong b, strong instead of strong * If it still doesn't work, you can share link to page where you use accordion, I can check easier Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care Link to comment
daniellenoakes Posted Friday at 05:12 PM Share Posted Friday at 05:12 PM 5 hours ago, tuanphan said: Use strong b, strong instead of strong * If it still doesn't work, you can share link to page where you use accordion, I can check easier I got it to work using your thread: with <strong> 01/ </strong> in the accordion title using code: #block-yui_3_17_2_1_1700055594134_17636 .accordion-item__title strong {font-family: 'montserrat'!important; font-size:12px!important; position:relative; top:-1vh!important; letter-spacing:0.2em!important; font-weight:400;} and this code in the page header code injection: <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script> $(document).ready(function(){ $("span.accordion-item__title").each(function(){ $(this).html($(this).text()); }); }); </script> Link to comment
daniellenoakes Posted Friday at 05:14 PM Share Posted Friday at 05:14 PM On 11/24/2023 at 3:30 AM, tuanphan said: #1. Use this /* Accordion Block - Expand all items */ .sqs-block-accordion li:nth-child(4) .accordion-item__dropdown { display: block !important; } #2. Each titles in each accordion will use a different font name or font color or? is there a way to use this code but then have the item close when another is expanded? i only want one open at a time ! thank you Link to comment
tuanphan Posted Sunday at 03:50 AM Share Posted Sunday at 03:50 AM On 12/2/2023 at 12:14 AM, daniellenoakes said: is there a way to use this code but then have the item close when another is expanded? i only want one open at a time ! thank you Can you share link to a page where you use accordion, I can check easier daniellenoakes 1 Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care Link to comment
daniellenoakes Posted Monday at 12:10 PM Share Posted Monday at 12:10 PM On 12/3/2023 at 3:50 AM, tuanphan said: Can you share link to a page where you use accordion, I can check easier www.annajonesbridal.co.uk/about-new Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment