1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Target _blank help in Bootstrap

Discussion in 'Site & Server Administration' started by flaminbo, Feb 5, 2018.

  1. #1
    Hi all, i have a website/script i am using that uses Bootstrap. Now i am not much of a coder at all, and need a bit of help, or a push in the right direction at least. The url to my website is gamestimeline.com

    Now what i really want to accomplish is to have links in the navbar, primarily the outbound links, to open in a new tab. But upon Googling, apparently its not as simple as adding "target=_blank" to the urls in bootstrap.

    Also upon Googling, i found this snippet of code that would make it work in Bootstrap, but of course being i am not a coder, this is where i need a push in the right direction, i am unsure how to impliment this in the template i need it in.

    This is the code i found that would make links open in a new tab
    
    jQuery(document).ready(function($) {
    $(".Item .Message a:external").attr("target", '_blank');
    $(" .Item .Message a").attr("target", '_blank');
    $('#Menu li:first > a').attr('target', '_blank'); //it is .navbar in Bootstrap
    $('.MessageList a').attr('target', '_blank');
    $('#Foot a').attr('target', '_blank'); //this called footer .sticky-footer
    $('.Attachment a').attr('target', '_blank');
    $('.Meta a').attr('target', '_self');
    $('a.ReactButton.Quote.Visible').attr('target', '_self');
    //for bootstrap themes
    $('.navbar a').attr('target', '_blank');//this will make all menu links open in new window
    $('a').attr('target', '_blank');//this will make all links open in a new window
    $('h3 a').attr('target', '_blank');//this will make category list title links open in new window.
    $('a.Title').attr('target', '_blank');//this will make discussion list title links open in a new window
    });
    Code (markup):
    and this is the template i would need to edit (i think anyway lol)
    [​IMG]

    thank-you in advance for any advice anyone could give me on this conundrum lol
     
    flaminbo, Feb 5, 2018 IP