Hoe zet je hier _blank

Status
Niet open voor verdere reacties.

hanna

Gebruiker
Lid geworden
8 sep 2000
Berichten
966
_blank in javascript

Hoe zet je hier in dit script dat de url in een nieuwe pagina moet openen?
Bedankt alvast.

Code:
<SCRIPT LANGUAGE="JavaScript">

//set image paths
src = ["images/bos.gif", "images/gasten.gif", "images/goud.gif"]


//set corresponding urls
url = ["http://www.xxx.nl", "http://www.xxx.nl", "http:www.xxx.nl"]

//set duration for each image
duration = 3;

//Please do not edit below
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>
 <a href="javascript:doLink();" onMouseOver="status=url[ct];return true;"
onMouseOut="status=''"><IMG SRC="images/slides1/1-01.jpg" NAME="Ad_Image"
hspace="0" BORDER=0></a>
 
Laatst bewerkt:
Dan moet je je script veranderen in dit:

PHP:
<SCRIPT LANGUAGE="JavaScript">

//set image paths
src = ["images/bos.gif", "images/gasten.gif", "images/goud.gif"]


//set corresponding urls
url = ["http://www.xxx.nl", "http://www.xxx.nl", "http:www.xxx.nl"]

//set duration for each image
duration = 3;

//Please do not edit below
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(){
window.open(url[ct],'mywindow','width=9999,height=9999,toolbar=yes,
location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,
resizable=yes') ;
} onload = function(){
if (document.images)
switchAd();
}
//-->
</SCRIPT>
 <a href="javascript:doLink();" onMouseOver="status=url[ct];return true;"
onMouseOut="status=''"><IMG SRC="images/slides1/1-01.jpg" NAME="Ad_Image"
hspace="0" BORDER=0></a>
 
zo werkt het wel;

function doLink(){
window.open(url[ct], "popup", "height=200,width=400,status=yes,toolbar=no,menubar=no,location=no");
} onload = function(){
if (document.images)
switchAd();
}

Bedankt voor het op weg helpen.
 
Status
Niet open voor verdere reacties.
Terug
Bovenaan Onderaan