Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #696856

    hi, is it possible to connect a link to the icon box?
    if you go now on my homepage , you can see 3 icon boxes at the bottom.
    putting the mouse over it, they does have links , but i linked the text itself (see the underlining) which is quite ugly.
    i try to put this text into a <div>
    but that didnt work.

    ps: you can choose to link to the title, or the title and the icon
    but not the title, icon AND text

    • This topic was modified 8 years, 3 months ago by yampieters.
    #696995

    Hi jelle,

    You have the Title Link? option in the element, do you mean that you want to link the whole element to the same place?

    Best regards,
    Rikard

    #697045

    hi rikard, ive found the title link option, but my client wants the whole rectangle to be clickable, see image

    #697596

    Hi,

    Please remove the link from the text and retain the title link. Add this code in the functions.php file.

    add_action('wp_footer', 'ava_custom_script');
    function ava_custom_script(){
    ?>
    <script type="text/javascript">
    (function($) {
    	function a() {
    		var iconbox = $('.iconbox'),
    			boxlink = '';
    
    		iconbox.on('click', function() {
    			boxlink = $(this).find('.iconbox_content_title a').attr('href');
    			window.location.href = boxlink;
    		});	
    	}
    
    	a();
    })(jQuery);
    </script>
    <?php
    }

    And this in the Quick CSS field:

    #top .iconbox {
        cursor: pointer;
    }

    Best regards,
    Ismael

    #697682

    works great, ismael, thanks

    but now on other pages where i dont want this its also happening…
    how to get rid of that?

    • This reply was modified 8 years, 2 months ago by yampieters.
    #698127

    Hi!

    Turn on the custom css class field, add a unique class attribute to the iconboxes where you want to apply the modification.

    // http://kriesi.at/documentation/enfold/turn-on-custom-css-field-for-all-alb-elements/

    Adjust the selector in this line.

    var iconbox = $('.yourcustomclass .iconbox'),
    

    Cheers!
    Ismael

    #698235

    hi ismael
    the above peace of code, ive changed the

    var iconbox = $(‘.iconbox’),
    into
    var iconbox = $(‘jelle.iconbox’)

    in the quick css ive put:
    #top .jelle.iconbox {
    cursor: pointer;
    }

    now i can see a custom class field below the text field in the icon box, see image ccf.jpg
    i fill in : jelle
    and yes, the pointer is now for the whole box. but…still ONLY the title is linking to the destination page.
    there is a ‘hand’ – pointer over the rest of the text, but once clicked its not linking
    see: http://jeelsites.nl/veiling/ (were talking about the left box called: Test.
    what is going wrong?

    NB: the code looks like this now:
    <script type=”text/javascript”>
    (function($) {
    function a() {
    var iconbox = $(‘jelle.iconbox’),
    boxlink = ”;

    iconbox.on(‘click’, function() {
    boxlink = $(this).find(‘jelle.iconbox_content_title a’).attr(‘href’);
    window.location.href = boxlink;
    });
    }

    a();
    })(jQuery);
    </script>

    • This reply was modified 8 years, 2 months ago by yampieters.
    #699742

    Hi,

    In the custom css class field, use “jelle” without the “dot” and then change the whole function with the following code.

    add_action('wp_footer', 'ava_custom_script');
    function ava_custom_script(){
    ?>
    <script type="text/javascript">
    (function($) {
    	function a() {
    		var iconbox = $('.jelle'),
    			boxlink = '';
    
    		iconbox.on('click', function() {
    			boxlink = $(this).find('.iconbox_content_title a').attr('href');
    			window.location.href = boxlink;
    		});	
    	}
    
    	a();
    })(jQuery);
    </script>
    <?php
    }
    

    Best regards,
    Ismael

    #699818

    ok ismael , thanks.
    i did exactly so but still the icon boxes NOT having a ‘jelle’ ID still are showing a pointer – hand. see image. not good.
    how to get rid of this?

    #700906

    Hi,

    use this code inside Quick CSS field:

    header.entry-content-header {
    pointer-events: none;
    }

    Best regards,
    Andy

    #701050

    hi andym thanks
    no sorry, still a hand….
    there is no link, but still comes a pointer-hand

    #701272

    Hi,

    it’s because of this code which you’re using:

    #top .iconbox {
    cursor: pointer;
    }

    Remove it and it should work fine.

    Best regards,
    Andy

    #701300

    hi andy
    ive changed that now into

    #top .jelle.iconbox {
    cursor: pointer;
    }

    to keep the pointer in the .jelle ID , and its oke now.

    thanks a lot!

    #702337

    Hi,

    glad we could help. Let us know in a new ticket if you have some more questions related to the theme. We are happy to assist you.

    Best regards,
    Andy

Viewing 14 posts - 1 through 14 (of 14 total)
  • The topic ‘turn icon box into button’ is closed to new replies.