Open Menu Item in new window

Support Forums Cian – WP Theme Open Menu Item in new window

Tagged: 

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #5254
    Sumit Rathore
    Participant

    I have added few custom links in the Menu bar and the following script it added in custom scripts.

    jQuery(‘#menu-item-677’).bind(‘click’, function(e) {
    location.href = ‘http://mysite.com/merchant’;
    });

    This is working fine. But the only problem is, the page is opening in the same tab/window.

    I wanted to open the link in a new tab/window. What attribute/code, shall I add to open these menu links in new window.
    The url attribute which we generally use is :-

    target = “_blanK”

    Please provide details

    #5257
    CreaboxThemes
    Keymaster

    Hi,

    use the next code:

    jQuery(‘#menu-item-677’).bind(‘click’, function(e) {
         window.open('http://mysite.com/merchant','_blank');
    });

    Regards

    • This reply was modified 4 years, 6 months ago by CreaboxThemes.
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.