Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #13898

    OK so I read on another thread the answer to this question about the social media icons and how to get them to OPEN up on another Tab or Window so the users don’t leave the main website.

    That’s great however, the CONTACT icon shouldn’t open up in another windows since that is on the main site.

    How can I edit that CODE so I can have all the “external” social media icons open in another window but the CONTACT icon stay on my current website.

    I hope this makes sense and would be nice to see it in the admin panel as an option when setting up the social icons.

    #81121

    So there is no way to do this then I take it.

    #81122

    Hi!

    Try following code – add it to js/avia.js:

    jQuery(".social_bookmarks a").filter(function() {
    return this.hostname && this.hostname !== location.hostname;
    }).attr('target', '_blank');

    Regards,

    Peter

    #81124

    Well I pasted that code to the very bottom of the avia.js file and it didn’t work.

    I have no idea what I’m doing so if it needs to go somewhere specific then just coping that code and pasting it in the file doesn’t work.

    Tried it both in IE & Firefox and it still opens up the contact form in another window or tab.

    #81125

    Hey!

    Did you edit the php code too? If yes please revert the change and remove the target=”_blank” attribute from the a href link.

    Regards,

    Peter

    #81126

    OK I think I follow you on this one but have a question.

    I edited some PHP file to get these things to just open up in another window.

    The problem then I discovered was that the Email would open up the contact page in another window.

    So every social ICON should open up in another window except for the Email/Contact one.

    So if I understand this correctly then I need to revert my PHP edit, not sure which file that is right now but will search again for it.

    After I revert it then use the above code in this post in that JS file and that will do exactly what I need?

    Thanks for the help

    #81127

    Yes exactly. The js code I posted above compares your domain name with the link/href url. If they’re equal the js script ignores them, however if they’re different it will add a target=”_blank” attribute to the link. The php code interferes with this logic because it adds a target=”_blank” to all links.

    #81128

    Thanks for your help this does now work.

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

The topic ‘Social Icon open type indivdual’ is closed to new replies.