BrieckBoogaard Posted October 7 Posted October 7 Site URL: https://www.brieckboogaard.com/ Hello, I want to make my images on my portfolio page clickable. This helps direct the user to the corresponding page. I have already add buttons underneath and want to keep them too. Is there someone who can write a CSS code to keep the buttons and make the images clickable with corresponding pages? Thank you in advance.
tuanphan Posted October 9 Posted October 9 You can use this to Website Tools > Code Injection > Footer <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script> $(document).ready(function() { $('body.homepage .list-item-media img').on('click', function() { var link = $(this).closest('.list-item').find('a.list-item-content__button').attr('href'); if (link) { window.location.href = link; } }); }); </script> <style> .list-item-media { 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!)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment