MacUn Posted September 23, 2021 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!
paul2009 Posted September 24, 2021 Posted September 24, 2021 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 ⬇️ Me: I'm Paul, a SQSP user for >18 yrs & Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥. Work: Founder of SF.DIGITAL. We provide 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. Buying a coffee is generous but optional.
MacUn Posted October 18, 2021 Author 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?
paul2009 Posted October 19, 2021 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. Me: I'm Paul, a SQSP user for >18 yrs & Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥. Work: Founder of SF.DIGITAL. We provide 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. Buying a coffee is generous but optional.
MacUn Posted October 19, 2021 Author 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.
paul2009 Posted October 19, 2021 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. Me: I'm Paul, a SQSP user for >18 yrs & Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥. Work: Founder of SF.DIGITAL. We provide 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. Buying a coffee is generous but optional.
MacUn Posted October 19, 2021 Author 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. 🙂
Recommended Posts
Archived
This topic is now archived and is closed to further replies.