Newbie needs help on img slideshow urls

Discussion in 'JavaScript' started by TheWeedMan, Oct 22, 2009.

  1. #1
    Hi im currently using a script to slideshow images with hyperlink functions however, my urls open in the same page and I need help getting them to open in a new seperate window called from the dolink() function.

    The script below is what im using, any help on this would be amazing as its driving me barmy.

    <SCRIPT LANGUAGE="JavaScript">
    <!--
    //set image paths
    src = ["images1.jpg", "images2.jpg"]

    //set corresponding urls
    url = ["http://www.url-images1", "http://www.url-images2"]

    //set duration for each image
    duration = 5;

    ads=[]; ct=0;
    function switchAd() {
    var n=(ct+1)%src.length;
    if (ads[n] && (ads[n].complete || ads[n].complete==null)) {
    document["Ad_Image"].src = ads[ct=n].src;
    }
    ads[n=(ct+1)%src.length] = new Image;
    ads[n].src = src[n];
    setTimeout("switchAd()",duration*1000);
    }
    function doLink(){
    location.href = url[ct];
    } onload = function(){
    if (document.images)
    switchAd();
    }
    //-->
    </SCRIPT>
     
    TheWeedMan, Oct 22, 2009 IP