Roxyjee Posted April 7, 2020 Share Posted April 7, 2020 Site URL: https://www.susanchalkermassage.com/ Hi Circle, I want to make my whole summary item div clickable. You'll see on the website its the summary items under modalities. (summery item png attached) I have tried the following <script> Y.on('domready', function(){ Y.one('.sqs-block-summary-v2 .summary-item').on('click', function(e){ window.location = $(this).find("a").attr("href"); return false; }); </script> and this $(".summary-item").click(function() { window.location = $(this).find("a").attr("href"); return false; }); nothing is happening! Thanks for reading. Link to comment
Solution tuanphan Posted April 7, 2020 Solution Share Posted April 7, 2020 use above code (code 2) + add this to Code Injection Header <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> Roxyjee 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
Roxyjee Posted April 8, 2020 Author Share Posted April 8, 2020 20 hours ago, tuanphan said: use above code (code 2) + add this to Code Injection Header <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> Thanks so much! It worked. Link to comment
dnmddy Posted May 19, 2022 Share Posted May 19, 2022 I've tried that code but it isnt working for me. What am I doing wrong? https://vc3.squarespace.com/clients-grid password: notyet Link to comment
creedon Posted May 19, 2022 Share Posted May 19, 2022 2 hours ago, dnmddy said: I've tried that code but it isnt working for me. What am I doing wrong? The code won't work with Lazy Summaries. When the code runs that are no summary items on the page yet. You need to use LS's Advanced options to do what you want. It is not easy. Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects. Link to comment
dnmddy Posted May 19, 2022 Share Posted May 19, 2022 1 minute ago, creedon said: The code won't work with Lazy Summaries. When the code runs that are no summary items on the page yet. You need to use LS's Advanced options to do what you want. It is not easy. Ah, that makes sense. Thanks for pointing that out. Re: "It is not easy"... yeah, that advanced section is over my head! Link to comment
dnmddy Posted May 19, 2022 Share Posted May 19, 2022 4 minutes ago, creedon said: The code won't work with Lazy Summaries. FWIW, I just deactivated Lazy Summaries on that block and it's still not working. Link to comment
creedon Posted May 20, 2022 Share Posted May 20, 2022 (edited) 4 hours ago, dnmddy said: I just deactivated Lazy Summaries on that block and it's still not working. I suspect then that how summary blocks are loaded changed from over two years ago when the code was written. Back then they probably loaded them when the page loaded. Now they probably load them lazily to be more performant. I don't recall how they used to be loaded vs how they are now loaded. I'm usually dealing with how things work now and sometimes forget how they used to work! 🙂 Perhaps someone can edify us just for grins. When things are lazily loaded (and not using lazy summaries) one needs to use a Mutation Observer. It is a way to watch for things to come onto the DOM. It is also not easy to code MO's. Edited May 20, 2022 by creedon Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects. 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