Tagged: ,

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #363542

    Good morning,

    This is a follow-up to a topic I started a few month age: https://kriesi.at/support/topic/pop-up-when-exiting-site-through-external-link/

    We got everything working perfectly, but my client also now wants external links going from the “Easy Slider” Media Element. The problem is there is no additional CSS I can add to these elements that I can see.

    Is there anything I can do?

    Best
    John

    #364114

    Hey jnhaswell!

    please refer to this post:
    https://kriesi.at/support/topic/add-a-link-to-easy-slider/#post-254028

    Regards,
    Andy

    #364568

    Andy,

    Thanks, I’m actually trying to get a pop-up to appear when external links are clicked. Ismael had these codes to make it work:

    <a class="external-link" href="http://www.google.com">Click Here</a>
    Edit functions.php, add this at the very bottom:

    function add_custom_script(){
    ?>
    <script>
    jQuery(window).load(function(){
    	jQuery('a.external-link').click(function() {
    		alert("You're going to a better place.");
    	});
    });
    </script>
    <?php
    }
    add_action('wp_head', 'add_custom_script');

    But the Easy Slider doesn’t seem to have the option to allow custom CSS in the link box? Did I miss something?

    Thanks!
    John

    #365104

    Hey John!

    Use this code instead:

    function add_custom_script(){
    ?>
    <script>
    jQuery(window).load(function(){
    	jQuery("a[href^='http:']").not("[href*='mydomain.com']").click(function() {
    		alert("You're going to a better place.");
    	});
    });
    </script>
    <?php
    }
    add_action('wp_footer', 'add_custom_script');

    Change “mydomain.com”.

    Cheers!
    Josue

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.