found404 Posted November 18 Posted November 18 @tuanphanHi, could you please take a look at my webpage? I would like to make the text box appear when hovering over the image and make the whole text box clickable. Thank you! https://www.hiirisdesign.com/home/#more
tuanphan Posted November 19 Posted November 19 You can use this code to Website Tools > Code Injection > Footer <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script> <script> $('section[data-section-id="67327a8bb0b27c5ce28e1805"] .fe-block').click(function(){ window.location=$(this).find("p a").attr("href"); return false; }); </script> <style> section[data-section-id="67327a8bb0b27c5ce28e1805"] .fe-block { cursor: pointer; } </style> Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)
Squareko Posted November 27 Posted November 27 Add this code into pages > web tools > code injection > footer : // Select all elements with the class 'fe-block' inside the specified section document.querySelectorAll('section[data-section-id="67327a8bb0b27c5ce28e1805"] .fe-block').forEach(function (block) { block.style.cursor = 'pointer'; // Set the cursor to pointer // Add a click event listener to each block block.addEventListener('click', function () { const link = block.querySelector('p a'); // Find the anchor tag inside the block if (link && link.href) { window.location = link.href; // Navigate to the href of the anchor tag } }); }); Let me know if it works or not.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment