[Javascript] NEW WINDOW PROPERTIES...

Cheran jegadcheran at yahoo.com
Mon Dec 9 00:09:52 CST 2002


Hi,
The following code works fine for a rotating banner with each banner
has different links and opening in a new window. so on clicking a
each banner it will open in a seperate window. but the links has to
open in a same one window. can it be done??
Regards,
Cheran

<html>
<head>
<title>Banner Demo</title>
<script type="text/javascript">

if (document.images)
{

    adImages = new Array("banner1.jpg",
                         "banner2.jpg",                              
                    
                         "banner3.jpg");

    adURLs = new Array("http://www.devhood.com",
                       "http://www.yahoo.com",
                       "http://www.google.com");
   
    thisAd = 0;
}

function cycleAds()
{
    if (document.images)
    {
        if (document.adBanner.complete)
        {
            if (++thisAd == adImages.length)
                thisAd = 0;

            document.adBanner.src = adImages[thisAd];
        }
    }

   
    setTimeout("cycleAds()", 1300);
}

function gotoAd()
{

document.location.href = window.open(adURLs[thisAd]);
	
}
</script>

<body bgcolor=ffffff onload="cycleAds()" >
<a href="#" onClick="javascript:gotoAd();" >
<img name="adBanner" src="banner1.jpg" border="0" alt="Click here to
visit these links" ></a>

</body>
</html>

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com



More information about the Javascript mailing list