Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #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?

    #1371863

    Hey 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,
    Ismael

    #1371907

    Hi 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 :-/

    #1372015

    Hi,

    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,
    Ismael

    #1372023

    I have shared a screenshot.
    It have styled the iconbox so it do not look like a typically iconbox.

    #1372173

    Hi,

    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

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.