-
AuthorPosts
-
November 8, 2022 at 1:55 pm #1371759
Hello,
I’m using a iconbox and have set the the link to be “Yes, apply link to icon and title”, but i need it to be on the whole button.
I tried to use the guide “How to make icon box clickable?” on https://kriesi.at/documentation/enfold/icon-box/ but that open it on in a new tab, and i need it to open in the iframe.
I do it when i click on the play button and the title.
What should i change from the guide or do i need another solution?
November 9, 2022 at 8:35 am #1371863Hey mvi,
Thank you for the inquiry.
You can use this script in the functions.php file to make the whole iconbox clickable.
// make the whole iconbox clickable function ava_custom_script_iconbox_link() { ?> <script type="text/javascript"> (function($) { $('.iconbox').on('click', function() { var title_link = $(this).find('.iconbox_content_title ').attr('href'); if(title_link) window.location.href = title_link; }); })(jQuery); </script> <?php } add_action( 'wp_footer', 'ava_custom_script_iconbox_link', 9999 );
Add this css code to change the cursor.
.iconbox { cursor: pointer; }
Best regards,
IsmaelNovember 9, 2022 at 2:50 pm #1371907Hi Ismael,
Thank you fro your solution, but unfortanly it is not working. It is still only the icon and headline that are clickable and open in the lightbox as it should :-/
November 10, 2022 at 7:33 am #1372015Hi,
We checked the page above but we didn’t find any iconboxes. Where did you add the elements? Would you mind providing a screenshot of the section? You can use imgur, savvyify or dropbox for the screenshot. Thanks.
Best regards,
IsmaelNovember 10, 2022 at 8:59 am #1372023I have shared a screenshot.
It have styled the iconbox so it do not look like a typically iconbox.November 11, 2022 at 9:23 am #1372173Hi,
Thank you for the screenshot.
We adjust the script a bit. Please try it again.
// make the whole iconbox clickable function ava_custom_script_iconbox_link() { ?> <script type="text/javascript"> (function($) { $('.iconbox').on('click', function() { var video_link = $(this).find('a'); video_link.trigger('click'); }); })(jQuery); </script> <?php } add_action( 'wp_footer', 'ava_custom_script_iconbox_link', 9999 );
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.