henvisning til html-dokument i anden frame
Jeg har problemer med at få dette menu-script til at åbne henvisningerne i en frame kaldet "right". Er der nogle som kan hjælpe mig lidt med problemet?<html>
<head>
<title>menu</title>
<style>
<!--
DIV.clTop{position:absolute; width:170}
DIV.clSub{position:absolute; left:10; width:170}
#divCont{position:relative; left:15; top:0; height:400; width:170;}
A.clMain{font-family:Arial, Times New Roman; font-size:14px; text-decoration:none; font-weight:bold; color:yellow}
A.clSubb{font-family:Arial, Times New Roman; font-size:14px; text-decoration:none; color:yellow}
#divMain{position:absolute}
//-->
</style>
<script language="JavaScript">
var stayFolded=false
//This is the image that it changes to when it expands.
var exImg=new Image(); exImg.src='aball.gif'
//This is the image is changes to with it's "unfolded" or something :}
//Remeber to change the actual images in the page aswell, but remember to
//keep the name of the image.
var unImg=new Image(); unImg.src='aball.gif'
/************************************************************************************
Browsercheck
************************************************************************************/
var n = (document.layers) ? 1:0;
var ie = (document.all) ? 1:0;
var browser=((n || ie) && parseInt(navigator.appVersion)>=4)
function makeMenu(obj,nest){
nest=(!nest) ? '':'document.'+nest+'.'
this.css=(n) ? eval(nest+'document.'+obj):eval('document.all.'+obj+'.style')
this.ref=(n) ? eval(nest+'document.'+obj+'.document'):eval('document');
this.height=n?this.ref.height:eval(obj+'.offsetHeight')
this.x=(n)? this.css.left:this.css.pixelLeft;this.y=(n)? this.css.top:this.css.pixelTop;
this.hideIt=b_hideIt; this.showIt=b_showIt; this.vis=b_vis; 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=="hide") return true;}
function b_moveIt(x,y){this.x=x; this.y=y; this.css.left=this.x; this.css.top=this.y}
/************************************************************************************
Initiating the page. Just add to the arrays here to get more menuitems
and add divs in the page
************************************************************************************/
function init(){
oTop=new Array()
oTop[0]=new makeMenu('divTop1','divCont')
oTop[1]=new makeMenu('divTop2','divCont')
oTop[2]=new makeMenu('divTop3','divCont')
oTop[3]=new makeMenu('divTop4','divCont')
oTop[4]=new makeMenu('divTop5','divCont')
oSub=new Array()
oSub[0]=new makeMenu('divSub1','divCont.document.divTop1')
oSub[1]=new makeMenu('divSub2','divCont.document.divTop2')
oSub[2]=new makeMenu('divSub3','divCont.document.divTop3')
oSub[3]=new makeMenu('divSub4','divCont.document.divTop4')
oSub[4]=new makeMenu('divSub5','divCont.document.divTop5')
for(i=0;i<oSub.length;i++){ oSub[i].hideIt() }
for(i=1;i<oTop.length;i++){ oTop[i].moveIt(0,oTop[i-1].y+oTop[i-1].height) }
}
/************************************************************************************
This is the function that changes the sub menus to folded or unfolded state.
************************************************************************************/
function menu(num){
if(browser){
if(!stayFolded){
for(i=0;i<oSub.length;i++){
if(i!=num){
oSub[i].hideIt()
oTop[i].ref["imgA"+i].src=unImg.src
}
}
for(i=1;i<oTop.length;i++){
oTop[i].moveIt(0,oTop[i-1].y+oTop[i-1].height)
}
}
if(oSub[num].vis()){
oSub[num].showIt()
oTop[num].ref["imgA"+num].src=exImg.src
}else{
oSub[num].hideIt()
oTop[num].ref["imgA"+num].src=unImg.src
}
for(i=1;i<oTop.length;i++){
if(!oSub[i-1].vis()) oTop[i].moveIt(0,oTop[i-1].y+oTop[i-1].height+oSub[i-1].height)
else oTop[i].moveIt(0,oTop[i-1].y+oTop[i-1].height)
}
}
}
//Initiating the menus onload, if it's a 4.x+ browser.
if(browser) onload=init;
</script>
</HEAD>
<body background="menu-bgr.jpg">
<font color="black"><h4><center><FONT color=#ffff00>Best experience:<br>
1024*768 resolution<br><EM>This site
requires at least a 4.x browser </EM></B></FONT></h4></font></CENTER>
<H5></H5>
<hr>
<!--************************************************************************************
Replace your links with the # inside the a tags to get links.
************************************************************************************-->
<div id="divCont">
<div id="divTop1" class="clTop"><A class=clMain href="??parent.right.document.location.href??" onclick="menu(0); return false"><IMG alt="" border=0 height=12 name=imgA0 src="aball.gif" width=12> Roxette</A><br>
<div id="divSub1" class="clSub">
<A class=clSubb href="roxette.htm">Discography</A><br>
<A class=clSubb href="mp3-samples.htm">Soundsamples</A><br>
<A class=clSubb href="Roxetteskins.htm">Winamp skins</A><br>
<A class=clsubb href="voting.html">Voting</A><br>
<A class=clsubb href="opinion.html">Your opinion</A><br>
<a class=clsubb href="review.html">Official reviews</a>
</div><br>
</div>
<div id="divTop2" class="clTop"><A class=clMain href="#" onclick ="menu(1); return false" ><IMG alt="" border=0 height=12 name=imgA1 src="aball.gif" width=12> MAME</A><br>
<div id="divSub2" class="clSub">
<A class=clSubb href="emulators.htm">Emulators</A><br>
<A class=clSubb href="roms.htm">Roms</A><br>
<A class=clsubb href="Idea of MAME.html">Idea of MAME</A><br>
</div><br>
</div>
<div id="divTop3" class="clTop"><A class=clMain href="#" onclick ="menu(2); return false" ><IMG alt="" border=0 height=12 name=imgA2 src="aball.gif" width=12> Chat</A><br>
<div id="divSub3" class="clSub">
<a href="http://www.larholm.dk/anders/chat/login.cgi" class="clSubb">Login</a><br>
</div><br>
</div>
<div id="divTop4" class="clTop"><a href="parent.right.document.location.href" onclick="menu(3); return false" class="clMain"><IMG alt="" border=0 height=12 name=imgA3 src="aball.gif" width=12> Guestbook</a><br>
<div id="divSub4" class="clSub">
<a href="" class="clSubb">Sign it</a><br>
<A class=clSubb href="#">Read it</A><br>
</div><br>
</div>
<div id="divTop5" class="clTop"><a href="" onclick="menu(4); return false" class="clMain"><IMG alt="" border=0 height=12 name=imgA4 src="aball.gif" width=12> Conference</a><br>
<div id="divSub5" class="clSub">
<A class=clSubb href="#">Compose message</A><br>
<A class=clSubb href="#">Read messages</A><br>
</div><br>
<BR></div>
</div>
</body>
</HTML>
