Hallo,
ich möchte sämtliche JavaScripts einer Seite in eine Datei "navi.js" und "popup.js" fassen und dies bebedarf ausführen lassen.
Die "popup.js" ist schon eine fertige Datei, aber die "navi.js" noch nicht! Wie kann ich diese einbinden zwei JS einbinden?!??!
HTML CODE:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0021)http://www........../ -->
<HTML><HEAD>
<title>titel</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css" >
<meta name="Content-Language" content="de">
<meta name="author" content="Autohr">
<meta name="KeyWords" content="">
<meta name="Description" content="" >
<link href="style/CSS.css" rel="stylesheet" type="text/css">
<style type="text/css">
#divCont {
position:absolute;
z-index:1;
left:103px;
top:235px;
height:400px;
width:170px;
visibility:hidden;
cursor: hand;
}
.clTop {position:absolute; z-index:1; width:170px; line-height:17px;}
.clSub {position:absolute; z-index:1; left:0px; top:20px; width:170px; line-height:14px;}
/*** This sets the style for the links inside the menu. ***/
#divCont .clTop a {color:#0000FF; font-family:verdana, arial, helvetica, sans-serif; font-size:14px; font-weight:bold; text-decoration:none;}
#divCont .clTop a:hover {color:#FF0000; text-decoration:none;}
#divCont .clTop .clSub a {color:#999999; font-family:verdana, arial, helvetica, sans-serif; font-size:12px; font-weight:normal; text-decoration:none;}
#divCont .clTop .clSub a:hover {color:#FF0000; text-decoration:none;}
</style>
>------NAVIGATION Anfang----------->
<script language="JavaScript" type="text/javascript">
function lib_bwcheck(){
this.ver=navigator.appVersion
this.agent=navigator.userAgent
this.dom=document.getElementById?1:0
this.opera5=this.agent.indexOf("Opera 5")>-1
this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0;
this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
this.ie=this.ie4||this.ie5||this.ie6
this.mac=this.agent.indexOf("Mac")>-1
this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0;
this.ns4=(document.layers && !this.dom)?1:0;
this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)
return this
}
var bw=new lib_bwcheck()
FoldNumber = 4 // Menüpunkte
var stayFolded = false
foldImg = 1
mainOffsetY = 0
var unImg=new Image();
unImg.src='../images/foldoutmenu_arrow.gif'
var exImg=new Image();
exImg.src='../images/foldoutmenu_arrow_open.gif'
var px = bw.ns4||window.opera?"":"px";
if(navigator.userAgent.indexOf('Opera')>-1 && document.getElementById){
scrX= innerWidth; scrY= innerHeight;
document.onmousemove= function(){
if(scrX<innerWidth-10 || scrY<innerHeight-10 || scrX>innerWidth+10 || scrY>innerHeight+10){
scrX = innerWidth;
scrY = innerHeight;
initFoldout();
}
};
}
function makeMenu(obj,nest){
nest= (!nest)?"":'document.'+nest+'.';
this.el= bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):document.getElementById(obj);
this.css= bw.ns4?this.el:this.el.style;
this.ref= bw.ns4?this.el.document:document;
this.x= (bw.ns4||bw.opera5)?this.css.left:this.el.offsetLeft;
this.y= (bw.ns4||bw.opera5)?this.css.top:this.el.offsetTop;
this.h= (bw.ie||bw.ns6)?this.el.offsetHeight:bw.ns4?this.ref.height:bw.opera5?this.css.pixelHeight:0;
this.vis= b_vis;
this.hideIt= b_hideIt;
this.showIt= b_showIt;
this.moveIt= b_moveIt;
return this
}
function b_showIt(){this.css.visibility='visible'}
function b_hideIt(){this.css.visibility='hidden'}
function b_vis(){if(this.css.visibility=='hidden' || this.css.visibility=='HIDDEN' || this.css.visibility=='hide') return true;}
function b_moveIt(x,y){this.x=x; this.y=y; this.css.left=this.x+px; this.css.top=this.y+px}
function menu(num){
if(bw.bw){
if (!stayFolded){
for (var i=0; i<oSub.length; i++){
if (i!=num){
oSub[i].hideIt()
if (foldImg)oTop[i].ref["imgA"+i].src = unImg.src
}
}
for(var i=1; i<oTop.length; i++){
oTop[i].moveIt(0,oTop[i-1].y+oTop[i-1].h)
}
}
if (oSub[num].vis()){
oSub[num].showIt()
if (foldImg)oTop[num].ref["imgA"+num].src = exImg.src
}else{
oSub[num].hideIt()
if(foldImg)oTop[num].ref["imgA"+num].src = unImg.src
}
for(var i=1; i<oTop.length; i++){
if (!oSub[i-1].vis()) oTop[i].moveIt(0,oTop[i-1].y+oTop[i-1].h+oSub[i-1].h+mainOffsetY)
else oTop[i].moveIt(0,oTop[i-1].y+oTop[i-1].h+mainOffsetY)
}
}
}
function initFoldout(){
bw.opera5 = (navigator.userAgent.indexOf("Opera")>-1 && document.getElementById)?true:false
if (bw.opera5) bw.ns6 = 0
oTop = new Array()
oSub = new Array()
for (var i=0; i<FoldNumber; i++){
oTop[i] = new makeMenu('divTop'+i,'divCont')
oSub[i] = new makeMenu('divSub'+i,'divCont.document.divTop'+i)
oSub[i].hideIt()
}
oTop[0].moveIt(0,0)
for (var i=1; i<oTop.length; i++){
oTop[i].moveIt(0, oTop[i-1].y+oTop[i-1].h+mainOffsetY)
}
oCont = new makeMenu('divCont')
oCont.showIt()
}
if(bw.bw) onload = initFoldout;
</script>
<------NAVIGATION ende-----------<
------popup Bild anfang----------->
<script type="text/javascript" src="dienstleistungen/popup.js"></script>
<------popup Bild ende-----------<
</head>
<body>
<table Id="rundrum" align="top" cellspacing="3" bgcolor="#FFFFFF">
<tbody><tr>
<td width="78%" colspan="3" align="left">
<table width="100%">
<tr>
<td width="28%"> </td>
<TD class=kurzuebersicht width="622">Ihr Metall- und Torbauer mit kreativen
und Inovativen Ideen in der Region!!</TD>
</tr>
</table>
</td>
</tr>
<tr bgColor="#0000FF">
<td class="rahmen" colspan="3" align="left"> </td>
</tr>
<tr>
<td width="22%" align="left" valign="top">
<div id="divCont">
<div id="divTop0" class="clTop"><a href="ueberuns.htm"><img src="images/foldoutmenu_arrow.gif" title="Über uns" name="imgA0" width=12 height=12 alt="Über uns" border="0"> über Uns</a><br>
<div id="divSub0" class="clSub">
</div><br>
</div>
<div id="divTop1" class="clTop"><a onclick="menu(1); return false" onfocus="this.blur()"><img src="images/foldoutmenu_arrow.gif" name="imgA1" width=12 height=12 alt="" border="0"> Dienstleitungen</a><br>
<div id="divSub1" class="clSub">
<a href="dienstleistungen/t%FCren.htm">Türen</a><br>
<a href="dienstleistungen/fenster.htm">Fenster</a><br>
<a href="dienstleistungen/gelaender.htm">Geländer</a><br>
<a href="dienstleistungen/wintergarten.htm">Wintergarten</a><br>
<a href="dienstleistungen/treppen.htm">Treppen</a><br>
<a href="dienstleistungen/torbau.htm">Torbau</a><br>
<a href="dienstleistungen/fassaden.htm">Fassaden</a><br>
<a href="dienstleistungen/daecher.htm">Dächer / Vordächer</a><br>
<a href="dienstleistungen/verglasungen.htm">Verglasungen</a><br>
</div><br>
</div>
<div id="divTop2" class="clTop"><a onclick="menu(2); return false" onfocus="this.blur()"><img src="images/foldoutmenu_arrow.gif" name="imgA2" width=12 height=12 alt="" border="0"> Kontakt</a><br>
<div id="divSub2" class="clSub">
<a href="kontakt/kongebe.htm">Metallbau Gebertingen</a><br>
<a href="kontakt/konesch.htm">Torbau Eschenbach</a><br>
</div><br>
</div>
<div id="divTop3" class="clTop"><a href="referenzen.htm"><img src="images/foldoutmenu_arrow.gif" title="Referenzen" name="imgA3"width=12 height=12 alt="Referenzen" border="0"> Referenzen</a><br>
<div id="divSub3" class="clSub">
</div><br>
</div>
</div><br>
</TD>
<TD height="300" colspan="2" class=inhalt>
<H1>Verglasungen</H1>
<table width="95%" align="left" class=tabelle>
<tr>
<td width="50%" align="center">
-----> popUp Bild (hier sollte der Verweis auf "popUp.js" sehen --->
<a href="images/images_ref/verglasungen1.jpg"
alt="Zum vergößern auf das Bild klicken"
title="Fassade mit Wintergarten"
onclick="return showBild(this);">
<img src="images/images_ref/verglasungen1.jpg" alt="" width="125" height="165" border="0"></a>
</td>
<td width="50%" align="left">Verglasung 1</td>
</tr>
</table></TD>
</TR></tbody>
</table>
</body>
</html>
Danke für Eure Hilfe!!
Gruss Grazioli