Home | Registrieren | Einloggen | Suchen | Aktuelles


Forum » Auszeichnungssprachen » datei.js und window.open Antworten
datei.js und window.open

weisseweste
Fachidiot


Beiträge: 112


Hallo zusammen,

ich habe mit Xara menu maker ein Navigationsmenü erstellt (js). Ich möchte gerne einen Link in dem Menü mit onclick window.open (neues Fenster, bestimmte Größe ) öffnen. Leider weiß ich nicht wo ich das in der js. Datei eingeben muß.

Please help ....

Hier das, was ich einfügen möchte:
1:
<a href="cgi-bin/pfad/datei.cgi" title="Titel" target="_top" onclick="window.open(this.href,'','alwaysRaised=yes,toolbar=yes,location=yes,menubar=yes,scrollbars=yes,resizable=yes,directories=no,width=650,height=500,screenX=10,top=10,left=10,screenY=10');return false;">Linkname</a>
.

Hier Inhalt der vorhandenen.js Datei:
1: 
2: 
3: 
4: 
5: 
6: 
7: 
8: 
9: 
10: 
11: 
12: 
13: 
14: 
15: 
16: 
17: 
18: 
19: 
20: 
21: 
22: 
23: 
24: 
25: 
26: 
27: 
28: 
29: 
30: 
31: 
32: 
33: 
34: 
35: 
36: 
37: 
38: 
39: 
40: 
41: 
42: 
43: 
44: 
45: 
46: 
47: 
48: 
49: 
50: 
51: 
52: 
53: 
54: 
55: 
56: 
57: 
58: 
59: 
60: 
61: 
62: 
63: 
64: 
65:
document.write("\n<!--\n");
document.write(".abv_menu {border-color:black;border-style:solid;border-width:"+bd+"px 0px "+bd+"px 0px;background-color:#cc0000;position:absolute;left:0px;top:0px;visibility:hidden;}");
document.write("a.abv_plain:link, a.abv_plain:visited{text-align:left;background-color:#cc0000;color:#ffffff;text-decoration:none;border-color:black;border-style:solid;border-width:0px "+bd+"px 0px "+bd+"px;padding:2px 0px 2px 0px;cursor:hand;display:block;font-size:8pt;font-family:Arial, Helvetica, sans-serif;font-weight:bold;}");
document.write("a.abv_plain:hover, a.abv_plain:active{background-color:#f3f3f3;color:#555555;text-decoration:none;border-color:black;border-style:solid;border-width:0px "+bd+"px 0px "+bd+"px;padding:2px 0px 2px 0px;cursor:hand;display:block;font-size:8pt;font-family:Arial, Helvetica, sans-serif;font-weight:bold;}");
document.write("a.abv_l:link, a.abv_l:visited{text-align:left;background:#cc0000 url("+loc+"abv_l.gif) no-repeat right;;color:#ffffff;text-decoration:none;border-color:black;border-style:solid;border-width:0px "+bd+"px 0px "+bd+"px;padding:2px 0px 2px 0px;cursor:hand;display:block;font-size:8pt;font-family:Arial, Helvetica, sans-serif;font-weight:bold;}");
document.write("a.abv_l:hover, a.abv_l:active{background:#f3f3f3 url("+loc+"abv_l2.gif) no-repeat right;color: #555555;text-decoration:none;border-color:black;border-style:solid;border-width:0px "+bd+"px 0px "+bd+"px;padding:2px 0px 2px 0px;cursor:hand;display:block;font-size:8pt;font-family:Arial, Helvetica, sans-serif;font-weight:bold;}");
document.write("\n-->\n");
document.write("</style>");

var fc=0x555555;
var bc=0xf3f3f3;
if(typeof(frames)=="undefined"){var frames=4;if(frames>0)animate();}

startMainMenu("",0,0,2,0,0)
mainMenuItem("abv_b1",".gif",14,38,loc+"../../1.php","","Eins",2,2,"abv_plain");
mainMenuItem("abv_b2",".gif",14,58,loc+"../../2.php","","Zwei",2,2,"abv_plain");
mainMenuItem("abv_b3",".gif",14,51,loc+"../../3.php","","Drei",2,2,"abv_plain");
mainMenuItem("abv_b4",".gif",14,54,loc+"../../4.php","","Vier",2,2,"abv_plain");
mainMenuItem("abv_b5",".gif",14,75,loc+"../../5.php","","Fuenf",2,2,"abv_plain");
mainMenuItem("abv_b6",".gif",14,65,loc+"../../cgi-bin/pfad/datei.cgi","","Sechs",2,2,"abv_plain");
mainMenuItem("abv_b7",".gif",14,93,loc+"../../7.php","","Sieben",2,2,"abv_plain");
mainMenuItem("abv_b8",".gif",14,37,loc+"../../8.php","","Acht",2,2,"abv_plain");
mainMenuItem("abv_b9",".gif",14,73,loc+"../../9.php","","Neun",2,2,"abv_plain");
mainMenuItem("abv_b10",".gif",14,50,loc+"../../10.php","","Zehn",2,2,"abv_plain");
endMainMenu("",0,0);

startSubmenu("abv_b3","abv_menu",167);
submenuItem("Unterpunkt_a_zuDrei",loc+"../../a.php","","abv_plain");
submenuItem("Unterpunkt_b_zuDrei",loc+"../../b.php","","abv_plain");
submenuItem("Unterpunkt_3_zuDrei",loc+"../../c.php","","abv_plain");
submenuItem("Unterpunkt_d_zuDrei",loc+"../../d.php","","abv_plain");
submenuItem("Unterpunkt_e_zuDrei",loc+"../../e.php","","abv_plain");
submenuItem("Unterpunkt_f_zuDrei",loc+"../../f.php","","abv_plain");
submenuItem("Unterpunkt_g_zuDrei",loc+"../../g.php","","abv_plain");
submenuItem("Unterpunkt_h_zuDrei",loc+"../../h.php","","abv_plain");
endSubmenu("abv_b3");

startSubmenu("abv_b2_4","abv_menu",118);
submenuItem("x1",loc+"../../x1.php","","abv_plain");
submenuItem("x2",loc+"../../x2.php","","abv_plain");
submenuItem("x3",loc+"../../x3.php","","abv_plain");
submenuItem("x4",loc+"../../x4.php","","abv_plain");
endSubmenu("abv_b2_4");

startSubmenu("abv_b2_2","abv_menu",240);
submenuItem("y1",loc+"../../y1.php","","abv_plain");
submenuItem("y2",loc+"../../y2.php","","abv_plain");
submenuItem("y3",loc+"../../y3.php","","abv_plain");
submenuItem("y4",loc+"../../y4.php","","abv_plain");
submenuItem("y5",loc+"../../y5.php","","abv_plain");
submenuItem("y6",loc+"../../y6.php","","abv_plain");
submenuItem("y7",loc+"../../y7.php","","abv_plain");
submenuItem("y8",loc+"../../y8.php","","abv_plain");
submenuItem("y9",loc+"../../y9.php","","abv_plain");
submenuItem("y10",loc+"../../y10.php","","abv_plain");
endSubmenu("abv_b2_2");

startSubmenu("abv_b2","abv_menu",101);
submenuItem("xx1",loc+"../../xx1.php","","abv_plain");
mainMenuItem("abv_b2_2","yy1",0,0,loc+"../../yy1.php","","",1,1,"abv_l");
submenuItem("xx2",loc+"../../xx2.php","","abv_plain");
mainMenuItem("abv_b2_4","yy2",0,0,loc+"../../yy2.php","","",1,1,"abv_l");
endSubmenu("abv_b2");

loc="";


PS: es gibt noch eine .js-Datei die das Programm erstellt hat, aber ich glaube nicht, daß der Code dort reingehört.

Danke,
weisseweste

  Profil   Editieren   Zitieren

languitar
Foren-Team


Beiträge: 2795


Xara wird doch bestimmt noch eine weitere Datei in die Seite einbinden, oder? Weil ohne deren Inhalt kann man über die ganzen Funktionsaufrufe in dieser nichts sagen.

---
Take a look here!
Lichtblick - Einblick - Ausblick

  Profil   E-Mail   Website   Editieren   Zitieren

weisseweste
Fachidiot


Beiträge: 112


Ja ..., dachte nur die ist nicht relevant ...

Hier also die zweite .js Datei: (habs jetzt etwas formatiert):


1: 
2: 
3: 
4: 
5: 
6: 
7: 
8: 
9: 
10: 
11: 
12: 
13: 
14: 
15: 
16: 
17: 
18: 
19: 
20: 
21: 
22: 
23: 
24: 
25: 
26: 
27: 
28: 
29: 
30: 
31: 
32: 
33: 
34: 
35: 
36: 
37: 
38: 
39: 
40: 
41: 
42: 
43: 
44: 
45: 
46: 
47: 
48: 
49: 
50: 
51: 
52: 
53: 
54: 
55: 
56: 
57: 
58: 
59: 
60: 
61: 
62: 
63: 
64: 
65: 
66: 
67: 
68: 
69: 
70: 
71: 
72: 
73: 
74: 
75: 
76: 
77: 
78: 
79: 
80: 
81: 
82: 
83: 
84: 
85: 
86: 
87: 
88: 
89: 
90: 
91: 
92: 
93: 
94: 
95: 
96: 
97: 
98: 
99: 
100: 
101: 
102: 
103: 
104: 
105: 
106: 
107: 
108: 
109: 
110: 
111: 
112: 
113: 
114:
var ma=new Array();
var mx=new Array();
var my=new Array();
var mc=new Array();
var mal=0;var main=0;
var menuw=200;
var psrc=0;
var pname="";
var al="";
var NS6=(!document.all&&document.getElementById);
var NS4=(!document.getElementById);
var IE5=(!NS4&&!NS6&&navigator.userAgent.indexOf('MSIE 5.0')!=-1);
if(navigator.userAgent.indexOf('Opera')!=-1)NS4=1;
function startMainMenu(file,h,w,dir,space,align){if(w>0)menuw=w;main=dir;
if(main==1||main==2)document.write("<table border=\"0\" cellspacing=\""+space+"\" cellpadding=\"0\">");
if(file!=""){al="";if(align==1)al=" align=\"right\"";
if(align==2)al=" align=\"center\"";
if(main==1||main==2)document.write("<tr><td"+al+">");document.write("<img src=\""+loc+file+"\" border=\"0\"");
if(h>0)document.write(" height=\""+h+"\"");
if(w>0)document.write(" width=\""+w+"\"");document.write(" />");
if(main==1||main==2)document.write("</td>");
if(main==1)document.write("</tr>");
if(main==3)document.write("<br></br>");}}function endMainMenu(file,h,w)
{if(file!=""){if(main==1)document.write("<tr>");
if(main==1||main==2)document.write("<td"+al+">");document.write("<img src=\""+loc+file+"\" border=\"0\"");
if(h>0)document.write(" height=\""+h+"\"");
if(w>0)document.write(" width=\""+w+"\"");
document.write(" />");
if(main==1||main==2)document.write("</td></tr>");}
if(main==1||main==2)document.write("</table>");main=0;}
function mainMenuItem(name,ext,h,w,url,tar,alt,dir,state,s)
{if(NS4&&main==0)return;var isgraphic=ext.charAt(0)==".";
if(main==1)document.write("<tr>");
if(main==1||main==2)document.write("<td"+al+">");document.write("<a ");
if(url!=""||!isgraphic)document.write("href=\""+url+"\" ");
if(tar!="")document.write("target=\""+tar+"\" ");document.write("onmouseout=\"");
if(dir>0)document.write("tidyMenu(event);");document.write("\" onmouseover=\"");
if(dir>0)document.write("openMenu(event, '"+name+"',"+dir+","+bc+","+fc+");");
if(state>1&&isgraphic){document[name+"_over"]=new Image();document[name+"_over"].src=loc+name+"_over"+ext;
document.write("setGraphic(event, '"+loc+name+"_over"+ext+"');");}document.write("return false;\"");
if(!isgraphic)document.write(" class=\""+s+"\" style=\"width:"+(w>0?w:menuw)+"px\"");document.write(">");
if(isgraphic){document.write("<img src=\""+loc+name+ext+"\" border=\"0\"");
if(h>0)document.write(" height=\""+h+"\"");
if(w>0)document.write(" width=\""+w+"\"");
if(alt!="")document.write(" alt=\""+alt+"\"");document.write(" />");}else{document.write("&nbsp;"+ext+"&nbsp;");}
document.write("</a>");if(main==1||main==2)document.write("</td>");
if(main==1)document.write("</tr>");
if(main==3)document.write("<br></br>");}function startSubmenu(name,style,sw){if(NS4)return;
if(sw>0)menuw=sw;document.write("<div id=\""+name+"\" class=\""+style+"\"  
style=\"width:"+(menuw+(NS6?bd*2:0))+"px\">");}
function endSubmenu(name){if(NS4)return;document.write("</div>");
if(!NS6)document.getElementById(name).onmouseout=tidyMenu;}function submenuItem(text,url,tar,s){if(NS4)return;
if(text.charAt(0)=='<')document.write(text);else{document.write("<a ");
if(url!="")document.write("href=\""+url+"\" ");
if(tar!="")document.write("target=\""+tar+"\" ");
document.write("class=\""+s+"\" style=\"width:"+menuw+"px\">&nbsp;"+text+"&nbsp;</a>");}}
function setGraphic(event,name)
{if(NS4)return;psrc=(NS6)?event.target:event.srcElement;pname=psrc.src;
if(NS6)event.target.src=name;else event.srcElement.src=name;}
function openMenu(event,id,pos,bc,fc){if(NS4)return;
var el,x,y;
if(mal>0){el=document.getElementById(ma[mal-1]);
if(mx[mal-1]!=el.offsetLeft||my[mal-1]!=el.offsetTop){el.style.left=mx[mal-1];
el.style.top=my[mal-1];}tidyMenu(event);}
if(NS6){if(mal==0){x=event.target.x-bd;
y=event.target.y;
dx=event.target.offsetWidth;
dy=event.target.offsetHeight;
if(typeof(event.target.x)=="undefined"){x=event.target.offsetLeft;y=event.target.offsetTop;}}
else{var p=event.target;
if(p.nodeName!="A"&&p.parentNode.nodeName=="A")p=p.parentNode;
dx=p.offsetWidth;dy=p.offsetHeight;
el=document.getElementById(ma[mal-1]);
x=el.offsetLeft-bd;y=el.offsetTop+p.offsetTop;}}
else{x=event.clientX-event.offsetX+document.body.scrollLeft-document.body.clientLeft;
y=event.clientY-event.offsetY+document.body.scrollTop-document.body.clientTop-bd;
dx=event.srcElement.offsetWidth;dy=event.srcElement.offsetHeight;
if(mal>0)x-=2*bd;}el=document.getElementById(id);
if(el&&el.style.visibility!="visible")
{if(pos==1){x+=dx;el.style.left=x-el.offsetWidth;el.style.top=y;nspeed=el.offsetWidth/frames;}
else if(pos==2)
{y+=dy;el.style.left=x;el.style.top=y-el.offsetHeight;nspeed=el.offsetHeight/frames;}
else if(pos==3)
{x-=el.offsetWidth;el.style.left=x+el.offsetWidth;el.style.top=y;nspeed=el.offsetWidth/frames;}
mx[mal]=x;my[mal]=y;
if(NS6||IE5||frames==0){el.style.left=x;el.style.top=y;}
if(!IE5)clipMenu(mal,el);el.style.visibility="visible";ma[mal]=id;
if(NS6){var p=event.target;
if(p.nodeName!="A"&&p.parentNode.nodeName=="A")p=p.parentNode;mc[mal]=p.style;el.onmouseout=tidyMenu;}
else{mc[mal]=event.srcElement.style;
if(mal>0){mc[mal].backgroundColor=bc;mc[mal].color=fc;}}mal++;}}
function overMenu(x,y){for(i=0;i<mal;i++)
{var el=document.getElementById(ma[i]);
if(el.offsetLeft+el.offsetWidth>x&&el.offsetLeft<=x&&el.offsetTop+el.offsetHeight>y&&el.offsetTop<=y)
{return ma[i];}}
return "";}function tidyMenu(e)
{if(NS4)return;
if(NS6){t=overMenu(e.pageX,e.pageY);
if(t!=""&&(e.target.firstChild==e.relatedTarget||e.target==e.relatedTarget.firstChild))return;}
else t=overMenu(event.clientX+document.body.scrollLeft-document.body.clientLeft,
event.clientY+document.body.scrollTop-document.body.clientTop);om=0;
for(i=0;i<mal;i++){var mail=ma[i].length;
if(mail>t.length||t.substring(0,mail)!=ma[i])
{var el=document.getElementById(ma[i]);el.style.visibility="hidden";mc[i].backgroundColor="";mc[i].color="";}
else{ma[om]=ma[i];mx[om]=mx[i];my[om]=my[i];om++;}}mal=om;
if(mal==0&&psrc)psrc.src=pname;}function animate(){for(i=0;i<mal;i++){var el=document.getElementById(ma[i]);
if(el.style.visibility=="visible"){if(el.offsetLeft<mx[i])el.style.left=Math.min(el.offsetLeft+nspeed,mx[i])+"px";
if(el.offsetLeft>mx[i])el.style.left=Math.max(el.offsetLeft-nspeed,mx[i])+"px";
if(el.offsetTop<my[i])el.style.top=Math.min(el.offsetTop+nspeed,my[i])+"px";clipMenu(i,el);}}
if(mal!=0||frames!=0)setTimeout("animate()",50);}function clipMenu(i,el)
{if(el.offsetLeft>mx[i])el.style.clip="rect("+(my[i]-el.offsetTop)+"px "
+(el.offsetWidth+(mx[i]-el.offsetLeft))+"px "+el.offsetHeight+"px "+0+"px)";
else el.style.clip="rect("+(my[i]-el.offsetTop)+"px "+el.offsetWidth+"px "
+el.offsetHeight+"px "+(mx[i]-el.offsetLeft)+"px)";}


Diese Nachricht wurde geändert von: weisseweste
  Profil   Editieren   Zitieren
 

Antworten
Nach oben