...

View Full Version : Help with Targeting within free menu script.



rgould
01-17-2003, 02:44 PM
I am using a free menu script and am a little stuck in trying to get the links to open in a new window.

The segment that (I believe) handles the links is as follows:

var menui = new Array();
var menul = new Array();

//configure below for menu items. Extend list as desired

menui[0]="Title1";
menui[1]="Title2";
menui[2]="Title3";
menui[3]="title4";
menui[4]="Title5";
menui[5]="Title6";

menul[0]="http://link1";
menul[1]="http://link2";
menul[2]="http://link3";
menul[3]="http://link4";
menul[4]="http://link5";
menul[5]="Http://link6";

for (i=0;i<=menui.length-1;i++)
if (ie4||ns6) {document.write('<TR><TD BORDERCOLOR="white" ONCLICK="location=\''+menul[i]+'\'" onmouseover="className=\'menuh\'" onMouseout="className=\'menu\'"><CENTER><FONT SIZE=2 FACE=Verdana COLOR=#000066>'+menui[i]+'</FONT></TD></TR>')}
else if (ns4){document.write('<TR><TD BGCOLOR="white"><ILAYER><LAYER width="'+menuwidth+'" onmouseover="bgColor=\'yellow\'" onmouseout="bgColor=\'white\'"><CENTER><A HREF="'+menul[i]+'" class=menulinks>'+menui[i]+'</A></CENTER></LAYER></ILAYER></TD></TR>')}


All I want to do is have each item open in either the same window (default) OR in a new window (and to specify each to include window siezes etc would be nice too!)

Any help would be much appreciated.

Thanks

Roy.

arnyinc
01-17-2003, 02:53 PM
Change the onclick from location to window.open

change this:
ONCLICK="location=''+menul[i]+''"

to either of these:
ONCLICK="window.open('+menul[i]+', '_blank')"

ONCLICK="window.open('+menul[i]+', '_self')"

No guarantees on my quotation marks or apostrophes :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum