Avatar billede k.r Nybegynder
22. juli 2003 - 20:16 Der er 5 kommentarer

problemer med menu script

jeg har et problem med menuen på www.fy-bong.dk den virker ikke i fofskellige opløsninger og den virker ikke på MAC.
Avatar billede ssundsdal Nybegynder
22. juli 2003 - 20:24 #1
Virker ellers helt fint med mig.
IE 6.0
Win xp ...
Avatar billede roenving Novice
23. juli 2003 - 01:26 #2
Den bliver jo heller ikke lagt rigtigt på plads i sit element -- du skal aftaste placeringen af elementet og lægge den derfra !-)
Avatar billede k.r Nybegynder
23. juli 2003 - 22:32 #3
er det noget du kan finde ud af , jeg har siddet og rodet med det og er helt blank :-()
Avatar billede roenving Novice
28. juli 2003 - 12:21 #4
-- jeg tror godt min standard-metode kan du, men jeg får først tid til at kigge nærmere på den senere ...

-- og det gælder selve positioneringen (forskellige opløsninger) -- hvordan Mac'erne reagerer ved jeg ikke !-)
Avatar billede roenving Novice
02. august 2003 - 02:27 #5
Så fik jeg kigget på det ;O)

Denne kode virker helt uden problemer i min egen test ...

Er der noget som skal tilpasses, må vi jo lige kigge på det !-)

<HTML>
<HEAD>
<TITLE>FY & BONG</TITLE>
<!-- Webmaster:
    Kenneth Rasmussen
    kr.kr@get2net.dk
-->
<style TYPE="text/css">
td {font-family:arial;color:#FFFFFF;font-size:11}
body {
scrollbar-3dlight-color: "000000";
scrollbar-arrow-color: "red";
scrollbar-base-color: "000000";
scrollbar-darkshadow-color: "000000";
scrollbar-face-color: "000000";
scrollbar-highlight-color: "00000";
scrollbar-shadow-color: "000000";
scrollbar-track-color: "000000";
}
DIV.clTop{position:absolute; width:144; }
DIV.clSub{position:absolute; left:10; width:144}
#divCont{position:relative; visibility:hidden; left:10; top:40; height:240; width:144;}
A.clMain{font-family: Verdana, Helvetica, Helv; font-size:11px; text-decoration:none; font-weight:bold;  color:ffffff;}
A.clMain:hover { color:B91C1C;  text-decoration: none; background-color:#CDCCCB;}
A.clSubb{font-family:Arial, Verdana, Helvetica, Helv; font-size:12px; text-decoration:none; color:ffffff; }
A.clSubb:hover { color:B91C1C;  font-size: 13px; text-decoration: underline; background-color:#CDCCCB;}
#divMain{position:absolute}
TD
{font-family: Verdana, Helvetica, Helv; font-size:11px; text-decoration:none;  color:black;}
</style> <!-- HER SLUTTER MENU-STYLE -->
<script type="text/javascript" language="JavaScript"><!-- HER ER PROBLEMET (tror jeg) DETTE ER MENUSCRIPTET -->
/*
//Default browsercheck, added to all scripts!
function checkBrowser(){
    this.ver=navigator.appVersion
    this.dom=document.getElementById?1:0

    this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
    this.ie4=(document.all && !this.dom)?1:0;

    this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
    this.ns4=(document.layers && !this.dom)?1:0;
    //added
    this.ie4mac=this.ie4 && navigator.userAgent.indexOf("Mac")>-1
    this.ie5mac=this.ie5 && navigator.userAgent.indexOf("Mac")>-1
    this.ie55=(this.ver.indexOf("MSIE 5.5")>-1 && this.dom)?1:0;
    this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5 || this.ie5mac)
    return this
}
*/

function checkBrowser(){ //Browsercheck (needed)
    this.ver=navigator.appVersion; this.agent=navigator.userAgent
    this.dom=document.getElementById?1:0
    this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
    this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0;
    this.ie4=(document.all && !this.dom)?1:0;
    this.ie=this.ie4||this.ie5||this.ie6
    this.mac=this.agent.indexOf("Mac")>-1
    this.opera5=this.agent.indexOf("Opera 5")>-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 || this.dom)
    return this
}
bw=new checkBrowser()
var stayFolded=false
//Do you want images (if not set to 0 and remove the images from the body)?
foldImg=1
//This is the image that it changes to when it expands.
var exImg=new Image(); exImg.src='bf.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='fb.gif'
function makeMenu(obj,nest){
    nest=(!nest) ? '':'document.'+nest+'.'
      this.css=bw.dom? document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+"document.layers." +obj):0;
    this.el=bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):0;
    this.ref=bw.dom || bw.ie4? document:bw.ns4?eval(nest+"document.layers." +obj+".document"):0;
    this.x=(bw.ns4 || bw.ns5)? this.css.left:this.css.pixelLeft;
    this.y=(bw.ns4 || bw.ns5)? this.css.top:this.css.pixelTop;
    this.height=bw.ns4?this.ref.height:this.el.offsetHeight;
    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}
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')
    oTop[5]=new makeMenu('divTop6','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')
    oSub[5]=new makeMenu('divSub6','divCont.document.divTop6')
    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) }
      oCont=new makeMenu('divCont')
      oCont.showIt()
    posDiv();
}
function menu(num){
    if(bw.bw){
        if(!stayFolded){
            for(i=0;i<oSub.length;i++){
                if(i!=num){
                    oSub[i].hideIt()
                    if(foldImg)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()
            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(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(bw.bw) onload=init;
function menu2(num){  // til brug for links der ikke åbner noget
    if(bw.bw){
        if(!stayFolded){
            for(i=0;i<oSub.length;i++){
                if(i!=num){
                    oSub[i].hideIt()
                    if(foldImg)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)
            }
        }
    }
};
function posDiv(){
    elm = document.getElementById('minTd');
    for(var zx=zy=0;elm!=null;zx+=elm.offsetLeft,zy+=elm.offsetTop,elm=elm.offsetParent);
    menuDiv = document.getElementById('divCont');
    menuDiv.style.position="absolute";
    menuDiv.style.top=zy+5+"px";
    menuDiv.style.left=zx+3+"px";
}
</script> <!-- HER SLUTTER MENUSCRIPTET -->
</HEAD>
<BODY BGCOLOR=#000000 leftmargin="0" topmargin="0" onresize="posDiv();">
<center>
<table border="0" WIDTH=100% HEIGHT=100%>
<tr>
<td align="center">
<table BORDER=1 bordercolor="303030" CELLPADDING=2 CELLSPACING=0>
<tr>
<td >
<!-- ImageReady Slices (forside.psd) -->
<TABLE WIDTH=778 BORDER=0 CELLPADDING=0 CELLSPACING=0>
    <TR>
        <TD COLSPAN=3>
            <IMG SRC="images/indexo_01.gif" WIDTH=778 HEIGHT=63></TD>
    </TR>
    <TR>
        <TD ROWSPAN=2>
            <IMG SRC="images/indexo_02.gif" WIDTH=26 HEIGHT=351></TD>
        <TD id="minTd" background="images/MENU.gif" WIDTH=144 HEIGHT=281>
<div id="divCont">
<!-- DETTE DIV ER MENU'EN -->
    <div id="divTop1" class="clTop"><A class=clMain onfocus="this.blur()" onclick="menu2(10)" href="11.htm" target="iframe"><IMG height=12 alt="" src="fb.gif" width=12 border=0 name=imgA0> Home</a><br>
        <div id="divSub1" class="clSub">
            </div><br>
    </div>
    <div id="divTop2" class="clTop"><A class=clMain onfocus="this.blur()" onclick="menu(1); return false" href="#"><IMG height=12 alt="" src="fb.gif" width=12 border=0 name=imgA1> Profil</a><br>
        <div id="divSub2" class="clSub">
            <!--<A class=clSubb href="forhandler.htm" target="iframe" onfocus="this.blur()"><IMG height=7 alt="" src="fb.gif" width=7 border=0> Celebraty</a><br>
            <A class=clSubb href="forhandler.htm" target="iframe" onfocus="this.blur()"><IMG height=7 alt="" src="fb.gif" width=7 border=0> Partner billeder</a><br>-->
        <A class=clSubb href="companyprofil.htm" target="iframe" onfocus="this.blur()"><IMG height=7 alt="" src="fb.gif" width=7 border=0> Company</a><br>
        </div><br>
    </div>
    <div id="divTop3" class="clTop"><A class=clMain onfocus="this.blur()" onclick="menu2(2)" href="collec.htm" target="iframe"><IMG height=12 alt="" src="fb.gif" width=12 border=0 name=imgA2> The collection</a><br>
        <div id="divSub3" class="clSub">
            <A class=clSubb href="tagwall.php?Bruger=<?php echo $Ryger; ?>" target="iframe" onfocus="this.blur()"><IMG height=7 alt="" src="fb.gif" width=7 border=0> Tagwall</a><br>
            <A class=clSubb href="oversigt.php?Kategori=Den Fede" target="iframe" onfocus="this.blur()"><IMG height=7 alt="" src="fb.gif" width=7 border=0> uploadere</a><br>
            <A class=clSubb href="dinside.htm" target="iframe" onfocus="this.blur()"><IMG height=7 alt="" src="fb.gif" width=7 border=0> Flash</a><br>
        <A class=clSubb href="dinside.htm" target="iframe" onfocus="this.blur()"><IMG height=7 alt="" src="fb.gif" width=7 border=0> Wazzzup</a><br>
            <A class=clSubb href="dinside.htm" target="iframe" onfocus="this.blur()"><IMG height=7 alt="" src="fb.gif" width=7 border=0> Links</a><br>
        </div><br>
    </div>
    <div id="divTop4" class="clTop"><a href=" forhandler.htm" onfocus="this.blur()" onclick="menu2(3)" class="clMain" target="iframe""><IMG height=12 alt="" src="fb.gif" width=12 border=0 name=imgA3> Din forhandler</a><br>
        <div id="divSub4" class="clSub">
            <A class=clSubb href="uc.html" target="iframe" onfocus="this.blur()" title="kommer snart..."><IMG height=7 alt="" src="fb.gif" width=7 border=0> Tulipanen</a><br>
            <A class=clSubb href="uc.html" target="iframe" onfocus="this.blur()" title="kommer snart..."><IMG height=7 alt="" src="fb.gif" width=7 border=0> Vindmøllen</a><br>
            <A class=clSubb href="uc.html" target="iframe" onfocus="this.blur()" title="kommer snart..."><IMG height=7 alt="" src="fb.gif" width=7 border=0> secret agent</a><br>
        <A class=clSubb href="uc.html" target="iframe" onfocus="this.blur()" title="kommer snart..."><IMG height=7 alt="" src="fb.gif" width=7 border=0> Video</a><br>
        </div><br>
    </div>
    <div id="divTop5" class="clTop"><a href="" onfocus="this.blur()" onclick="menu(4); return false" class="clMain"><IMG height=12 alt="" src="fb.gif" width=12 border=0 name=imgA4> Arrangementer</a><br>
        <div id="divSub5" class="clSub">
            <A class=clSubb href="hiphopidk.htm" target="iframe" onfocus="this.blur()"><IMG height=7 alt="" src="fb.gif" width=7 border=0> hip hop i DK</a><br>
            <!--<A class=clSubb href="forhandler.htm" target="iframe" onfocus="this.blur()"><IMG height=7 alt="" src="fb.gif" width=7 border=0> hip hop i EU</a><br>
        <A class=clSubb href="forhandler.htm" target="iframe" onfocus="this.blur()"><IMG height=7 alt="" src="fb.gif" width=7 border=0> Grafitti</a><br>-->
        </div><br>
    </div>
    <div id="divTop6" class="clTop"><a href="" onfocus="this.blur()" onclick="menu(5); return false" class="clMain"><IMG height=12 alt="" src="fb.gif" width=12 border=0 name=imgA5>  Kontakt os</a><br>
        <div id="divSub6" class="clSub">
            <A class=clSubb href="personlig kontakt.htm" target="iframe" onfocus="this.blur()"><IMG height=7 alt="" src="fb.gif" width=7 border=0> Personligt</a><br>
        <A class=clSubb href="kontaktdetail.htm" target="iframe" onfocus="this.blur()"><IMG height=7 alt="" src="fb.gif" width=7 border=0> forhandlere</a><br>
        <A class=clSubb href="risros.htm" target="iframe" onfocus="this.blur()"><IMG height=7 alt="" src="fb.gif" width=7 border=0> ris & ros</a><br>
        </div><br>
    </div>
</div> <!-- SLUT MENU-DIV -->
</TD>
        <TD WIDTH=608 HEIGHT=281>
            <iframe name="iframe" frameborder="0" WIDTH=100% HEIGHT=100% src="11.htm"> </iframe></TD>
    </TR>
    <TR>
        <TD COLSPAN=2>
            <IMG SRC="images/indexo_05.gif" WIDTH=752 HEIGHT=70></TD>
    </TR>
</TABLE>
<!-- End ImageReady Slices -->
</td>
</tr>
</table>
</td>
</tr>
</table>
</BODY>
</HTML>
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester