Home Forums Air WordPress Theme Setting all Buttons to target _blank ?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #16892
    canbekley
    Participant
    Purchased

    Hello BWSM,

    I tried to find a solution myself, but everything I tried so far has failed. I want all buttons of the class ‘ux-btn’ to open in a new tab/window, so I tried to implement a javascript code, that goes like this: $('#ux-btn a').attr('target', '_blank');
    I have tried plugins for javascript implementation. I have tried to import a js file with that code into the header.php. I have also tried typing this line directly into the header in a script tag. Nothing worked so far.
    Can you help me out maybe?

    Thank you alot, I appreciate it.
    Can

    #16894
    SeaTheme
    Keymaster
    Purchased

    Hi,

    Please use the js code like:

    jQuery('#ux-btn a').on('click', 'a', function(e){ 
        e.preventDefault(); 
        var url = jQuery(this).attr('href'); 
        window.open(url, '_blank');
    });

    Regards!
    Bwsm – uiueux.comTwitterFacebook

    #16895
    SeaTheme
    Keymaster
    Purchased
    This reply has been marked as private.
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

Join Newsletter(FREE)

Subscribe to our newsletter to receive news & updates. We promise to not spam you, super promise!