Announcement

Collapse
No announcement yet.

How can I make the banner links pop in a new window?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How can I make the banner links pop in a new window?

    This is the banner code below that I use works great, but they dont pop up in a new window. I think I can place a target_blank in somewhere, and maybe I dont?



    <!-- Goose Hunting banners Below-->

    <div style="width:30%; margin:0 auto">
    <if condition="$forumid == 54">
    <script language="JavaScript">
    <!--
    function adArray() {
    for (i=0; i*2<adArray.arguments.length; i++) {
    this[i] = new Object();
    this[i].src = adArray.arguments[i*2];
    this[i].href = adArray.arguments[i*2+1];
    }
    this.length = i;
    }
    function getAdNum() {
    dat = new Date();
    dat = (dat.getTime()+"").charAt(8);
    if (dat.length == 1)
    ad_num = dat%ads.length;
    else
    ad_num = 0;
    return ad_num;
    }


    var ads = new adArray(
    "images/banners/LewisOutdoorAdvturesbanner.gif","http://www.lewisoutdooradventures.com",
    "images/banners/flocknocker.gif","http://www.flocknockers.com",
    "images/banners/ColumbiaBasinWatfowlBannernew.jpg","http://www.basinwaterfowl.com",
    "images/banners/StormOutfittersbanner.jpg","http://www.stormoutfitters.com");

    var ad_num = getAdNum(); // don't change this line

    document.write(''
    +'<A HREF="'+ads[ad_num].href+'"><IMG SRC="'+ads[ad_num].src+'" '
    +'BORDER=0 name=js_ad>');

    // ****** YOU NEED NOT MODIFY ANYTHING THAT IS NOT IN BETWEEN THESE TWO COMMENTS ****

    link_num = document.links.length-1;

    function rotateSponsor() {
    if (document.images) {
    ad_num = (ad_num+1)%ads.length;
    document.js_ad.src = ads[ad_num].src;
    document.links[link_num].href = ads[ad_num].href;
    setTimeout("rotateSponsor()",45000);
    }
    }
    setTimeout("rotateSponsor()",45000);

    // -->
    </script>
    </if>
    </div>

  • #2
    Change:

    <A HREF="'+ads[ad_num].href+'">

    To:

    <A HREF="'+ads[ad_num].href+'" target="_blank">
    Translations provided by Google.

    Wayne Luke
    The Rabid Badger - a vBulletin Cloud demonstration site.
    vBulletin 5 API - Full / Mobile
    Vote for your favorite feature requests and the bugs you want to see fixed.

    Comment

    Loading...
    Working...
    X