adifederico Posted October 17, 2022 Share Posted October 17, 2022 Site URL: https://www.keystorage.com/resource-center Issue 1: I have a page I am developing where I have block areas I made with the text tool. the text area has a background image which makes it seem more like a button block. The problem I have run into is only the text is linked and not the entire background area which I did setup with a pointer. I have tried to add an eventlistener using JavaScript to make that whole area clickable and then load another page on click. Nothing I seem to do works. I was using this code here I got from w3schools: <script> document.getElementById("block-yui_3_17_2_1_1665162425531_150044").addEventListener("click", loadExternalPage); function loadExternalPage() { window.location.href = "https://info.keystorage.com/s/PKJLgJMExM3M9yW"; } </script> Issue 2: I use background images from the static and hover image states. While hovering the image changes to its hover background image but there is a flicker of blue that comes before the hover state. Im pretty sure this blue comes from the section intrinsic color theme I have chosen. Is there away to get rid of that blue flicker? Link to comment
Solution adifederico Posted October 21, 2022 Author Solution Share Posted October 21, 2022 I have finally found a solution. I used this code here: <script> $(document).ready(function() { $('#block-yui_3_17_2_1_1665162425531_150044').attr("href", "https://info.keystorage.com/s/PKJLgJMExM3M9yW"); window.addEventListener('load', function(){ document.querySelector('[href="https://info.keystorage.com/s/PKJLgJMExM3M9yW"]').addEventListener('click', function() { window.location = "https://info.keystorage.com/s/PKJLgJMExM3M9yW"; }) }) }); </script> I found it here (https://www.therapistsitetoolbox.com/blog/redirect-a-folder-click-squarespace) and tweaked it a bit. I placed code in advanced code injection and it worked. 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