MacUn Posted September 23, 2021 Share Posted September 23, 2021 Site URL: https://carrot-bronze-bld8.squarespace.com/coop-curbside Hello! I was able to create a collapsible FAQ through a markdown block and the following code but the content does not collapse on mobile--any ideas how to resolve? <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> <script> $(document).ready(function(){ $('.markdown-block .sqs-block-content h3').css('cursor','pointer'); $(".markdown-block .sqs-block-content h3").nextUntil("h3").slideToggle(); $(".markdown-block .sqs-block-content h3").click(function() {$(this).nextUntil("h3").slideToggle();}); }); </script> Thank you! Link to comment
paul2009 Posted September 24, 2021 Share Posted September 24, 2021 (edited) On 9/23/2021 at 6:01 PM, mackenzieu said: I was able to create a collapsible FAQ through a markdown block and the following code but the content does not collapse on mobile--any ideas how to resolve? It doesn't work because of a Brine feature called Ajax Page Loading - a fantastic feature that makes Brine sites load more quickly. You may not realise this, but the FAQ does not work for desktop visitors either. This is because the Ajax page loading feature gets disabled when you're logged on to your site. This can give you a flase sense of security. It's always a good idea to open a site in an Incognito window (without logging on) when you are testing it. To prevent the FAQ issues, you'll want to change the code placement (place it in a Code Block within the page above the FAQ) or disable Ajax Page Loading altogether - although this will slow down the site. See my guide here: Why does Squarespace code only work on refresh? Also you (and other readers) may want to note that the code snippet you've used is very old and uses an old version of jQuery that has known security vulnerabilities. You'll want to use the up-to-date version (currently 3.6.1). If this post has helped you, please click an icon below ⬇️ Edited September 11, 2022 by paul2009 MacUn 1 About me: I've been a SQSP User for 18 yrs. I was invited to join the Circle when it launched in 2016. I have been a Circle Leader since 2017. I don't work for Squarespace. I value honesty, transparency, diversity and good design ♥. Work: I founded and run SF.DIGITAL, building Squarespace Extensions to supercharge your commerce website. Content: Views and opinions are my own. Links in my posts may refer to SF.DIGITAL products or may be affiliate links. Forum advice is free. You can thank me by clicking one of the feedback emojis below. Coffee is optional. Link to comment
MacUn Posted October 18, 2021 Author Share Posted October 18, 2021 @paul2009Thanks! I was able to get the updated code added to the page, however it is still not collapsing on mobile--is there any way to get that working? Link to comment
paul2009 Posted October 19, 2021 Share Posted October 19, 2021 11 hours ago, mackenzieu said: it is still not collapsing on mobile I'm not seeing that issue when I take a look. About me: I've been a SQSP User for 18 yrs. I was invited to join the Circle when it launched in 2016. I have been a Circle Leader since 2017. I don't work for Squarespace. I value honesty, transparency, diversity and good design ♥. Work: I founded and run SF.DIGITAL, building Squarespace Extensions to supercharge your commerce website. Content: Views and opinions are my own. Links in my posts may refer to SF.DIGITAL products or may be affiliate links. Forum advice is free. You can thank me by clicking one of the feedback emojis below. Coffee is optional. Link to comment
MacUn Posted October 19, 2021 Author Share Posted October 19, 2021 Hmm... When I test it on my iPhone it's not functioning correctly and it looks like the screenshot below, but when I go to mobile width on desktop it collapses correctly. Link to comment
paul2009 Posted October 19, 2021 Share Posted October 19, 2021 10 minutes ago, mackenzieu said: When I test it on my iPhone it's not functioning correctly It's difficult for me to troubleshoot as it's good for me on iPhone too. About me: I've been a SQSP User for 18 yrs. I was invited to join the Circle when it launched in 2016. I have been a Circle Leader since 2017. I don't work for Squarespace. I value honesty, transparency, diversity and good design ♥. Work: I founded and run SF.DIGITAL, building Squarespace Extensions to supercharge your commerce website. Content: Views and opinions are my own. Links in my posts may refer to SF.DIGITAL products or may be affiliate links. Forum advice is free. You can thank me by clicking one of the feedback emojis below. Coffee is optional. Link to comment
MacUn Posted October 19, 2021 Author Share Posted October 19, 2021 Wow that's so bizarre. I tested on some other devices and it's working fine there too! Thank you so much for your help--must be something wonky with my phone. 🙂 paul2009 1 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