Avatar billede one Nybegynder
08. november 1999 - 21:50 Der er 8 kommentarer og
1 løsning

layerdropdown

hejsa kan det lade sig gøre  ? 
hvor jeg har  4 dropdowns  med forskelligt indhold    men alt skal være med tekst  altså ikke nogen billeder  (=  jeg har set det på 

microsoft.dk
cdm.dk
viborgnet.dk 

Andreas
Avatar billede jumper Nybegynder
08. november 1999 - 23:05 #1
Tja, kig i koden hos dem.

/Thor
Avatar billede one Nybegynder
08. november 1999 - 23:09 #2
men det er jo asp    eller noget
Avatar billede jumper Nybegynder
08. november 1999 - 23:11 #3
Nej, det er Javascript og DHTML.

"View" - "Source"

/Thor
Avatar billede one Nybegynder
08. november 1999 - 23:16 #4
hehe du får 1000 point hvis du kan lave det til mig  helt tilpasset

(=

Andreas
Avatar billede jumper Nybegynder
08. november 1999 - 23:18 #5
layerdropdownmenuer er kedelige at lave, smid lidt $$ oveni og jeg laver det med det vuns ;)

/Thor
Avatar billede one Nybegynder
08. november 1999 - 23:21 #6
hvor meget?
Avatar billede skjoldby Nybegynder
08. november 1999 - 23:40 #7
Her er et script fra Bratta.com jeg har redigeret lidt i. Det ser lidt pænere ud end hans, da jeg har centeret menuerne og undermenuerne.



<div id="divBg">
<div id="divBgColor"></div>
  <div id="divTop0" class="clTop"><a href="#" onmouseover="extract(0)">Humor</a>
    <div id="divSub0" class="clSub">
        <a href="test.html" onmouseover="ieShow(0)" onmouseout="ieShow(0)">Menulink 1</a><br>
        <a href="test.html" onmouseover="ieShow(0)" onmouseout="ieShow(0)">Menulink 2</a><br>
        <a href="test.html" onmouseover="ieShow(0)" onmouseout="ieShow(0)">Menulink 3</a><br>
        <br>
        </div>
    </div>
   
   
  <div id="divTop1" class="clTop"> <a href="#" onmouseover="extract(1)">Artikler/hist.</a>
    <div id="divSub1" class="clSub">
                  <a href="test.html" onmouseover="ieShow(1)" onmouseout="ieShow(1)">Menulink 1</a><br>
        <a href="test.html" onmouseover="ieShow(1)" onmouseout="ieShow(1)">Menulink 2</a><br>
        <a href="test.html" onmouseover="ieShow(1)" onmouseout="ieShow(1)">Menulink 3</a><br>
        <br>
        </div>
    </div>
   
   
  <div id="divTop2" class="clTop"> <a href="#" onmouseover="extract(2)">Dikt</a>
    <div id="divSub2" class="clSub">
              <a href="test.html" onmouseover="ieShow(2)" onmouseout="ieShow(2)">Menulink 1</a><br>
        <a href="test.html" onmouseover="ieShow(2)" onmouseout="ieShow(2)">Menulink 2</a><br>
        <a href="test.html" onmouseover="ieShow(2)" onmouseout="ieShow(2)">Menulink 3</a><br>
        <br>
        </div>
    </div>
   
   
  <div id="divTop3" class="clTop"> <a href="#" onmouseover="extract(3)">Parodier</a>
    <div id="divSub3" class="clSub">
              <a href="test.html" onmouseover="ieShow(3)" onmouseout="ieShow(3)">Menulink 1</a><br>
        <a href="test.html" onmouseover="ieShow(3)" onmouseout="ieShow(3)">Menulink 2</a><br>
        <a href="test.html" onmouseover="ieShow(3)" onmouseout="ieShow(3)">Menulink 3</a><br>
        <br>
        </div>
    </div>
   
   
  <div id="divTop4" class="clTop"> <a href="#" onmouseover="extract(4)">Linker</a>
    <div id="divSub4" class="clSub">
              <a href="test.html" onmouseover="ieShow(4)" onmouseout="ieShow(4)">Menulink 1</a><br>
        <a href="test.html" onmouseover="ieShow(4)" onmouseout="ieShow(4)">Menulink 2</a><br>
        <a href="test.html" onmouseover="ieShow(4)" onmouseout="ieShow(4)">Menulink 3</a><br>
        <br>
        </div>
    </div>

   
  <div id="divTop5" class="clTop"> <a href="#" onmouseover="extract(5)">Lister</a>
    <div id="divSub5" class="clSub">
              <a href="test.html" onmouseover="ieShow(5)" onmouseout="ieShow(5)">Menulink 1</a><br>
        <a href="test.html" onmouseover="ieShow(5)" onmouseout="ieShow(5)">Menulink 2</a><br>
        <a href="test.html" onmouseover="ieShow(5)" onmouseout="ieShow(5)">Menulink 3</a><br>
        <br>
        </div>   
    </div>

   
  <div id="divTop6" class="clTop"> <a href="#" onmouseover="extract(6)">Annet</a>
    <div id="divSub6" class="clSub">
              <a href="test.html" onmouseover="ieShow(6)" onmouseout="ieShow(6)">Menulink 1</a><br>
        <a href="test.html" onmouseover="ieShow(6)" onmouseout="ieShow(6)">Menulink 2</a><br>
        <a href="test.html" onmouseover="ieShow(6)" onmouseout="ieShow(6)">Menulink 3</a><br>
        <br>
        </div> 
    </div>
</div>



Avatar billede skjoldby Nybegynder
09. november 1999 - 00:03 #8
undskyld der mangler vist noget. jeg sender det lige til dig andreas. Så kan jeg give svaret når jeg har rettet det til for dig.
Avatar billede skjoldby Nybegynder
09. november 1999 - 00:53 #9
Her er den:

<html>
<head>
<title>Menu</title>





<style>
body{background-color:#000000}
A:link{color:#ffffff; text-decoration:none}
A:hover{color:#ffffff; text-decoration:underline}
A:visited{color:#ffffff; text-decoration:none}
TD{font-family:verdana,arial,helvetica; font-size:10pt}


#divBg{position:absolute; width:400; top:0; left:0; visibility:hidden; height:100;}
#divBgColor{position:absolute; top:0; left:0; width:630; height:20; clip:rect(0,400,20,0); background-color:#000000; layer-background-color:#000000}

DIV.clTop{position:absolute; font-family:verdana, arial, helvetica; text-align:left; font-weight:bold; font-size:10px; color:#ffffff; visibility:visible; left:100; top:20; width:66; clip:  rect(  )}
DIV.clSub{position:absolute; top:15; left:0; width:66;  visibility:hidden; font-family:verdana, arial, helvetica; font-weight:normal; font-size:10px; background-color:#999999; layer-background-color:#999999; text-align:center; color:#FFFFCC; clip:  rect(0 66 40 0)}

#divTop0{left:0; top:5}
#divTop1{left:66; top:5}
#divTop2{left:132; top:5}
#divTop3{left:198; top:5}
#divTop4{left:264; top:5}
#divTop5{left:330; top:5}
</style>



<script language="JavaScript1.2">

/********************************************************************************
Copyright (C) 1999 Thomas Brattli
This script is made by and copyrighted to Thomas Brattli at www.bratta.com
Visit for more great scripts.
This may be used freely as long as this msg is intact!
********************************************************************************
Browsercheck:*/
ie=document.all?1:0
n=document.layers?1:0

//Do you want it to move with the page if the user scroll the page?
var moveOnScroll=true

//How many menus do you have
numberOfMenus=6


//Do you want to hide all the other submenus when you click a new?
var hideAll=true

/********************************************************************************
If you want to change the appearans on the text, or background or anything
do that in the style tag above, or in the table tag below.

The different event handling on the different browsers makes this a little
tricky. I had to make all divs absolute positioned to make it work in netscape.
So if you ad or remove menuitems please play with the % values of each divTop
in the stylesheet. I have not had all that much luck with % placement before
in netscape so if you encounter any errors et me know and I'll see what I can do.
********************************************************************************/


/********************************************************************************
Object constructor
********************************************************************************/
function makeMenuBar(obj,nest,vis){
    nest=(!nest) ? '':'document.'+nest+'.'
    this.css=(n) ? eval(nest+'document.'+obj):eval(obj+'.style')
    this.hideIt=b_hideIt;    this.showIt=b_showIt                   
    if(ie && vis) this.css.visibility='hidden'
    this.evnt=(n)? eval(nest+'document.'+obj):eval(obj);   
    this.go=0
    this.height=n?this.css.document.height:eval(obj+'.offsetHeight')
    this.top=b_gettop
    this.obj = obj + "Object";     eval(this.obj + "=this")   
}
//Get's the top position.
function b_gettop(){
        var gleft=(n) ? eval(this.css.top):eval(this.css.pixelTop);
        return gleft;
}
//The functions for showing and hiding
function b_showIt(){
        this.css.visibility="visible"
}
function b_hideIt(){
        this.css.visibility="hidden"
}
/********************************************************************************
Checking if the page is scrolled, if it is move the menu after
********************************************************************************/
function checkScrolled(){
        if(!oMenu.go)oMenu.css.top=(!oMenu.state)?eval(scrolled):eval(scrolled)
        if(n) setTimeout('checkScrolled()',30)
}
/********************************************************************************
Inits the page, makes the menu object, moves it to the right place,
show it..
********************************************************************************/
function menuBarInit(){
        oSub=new Array()
        oTop=new Array()
        for(i=0;i<numberOfMenus;i++){
                oTop[i]=new makeMenuBar('divTop'+i,'divBg')
                oSub[i]=new makeMenuBar('divSub'+i,'divBg.document.divTop'+i,1)
                oSub[i].evnt.onmouseout=evOut;
        }
        //Moving menuBar
        oMenu=new makeMenuBar('divBg')
        scrolled=n?"window.pageYOffset":"document.body.scrollTop"
        oMenu.css.top=eval(scrolled)
        oMenu.css.visibility='visible'
        if(moveOnScroll) ie?window.onscroll=checkScrolled:checkScrolled();

}

/********************************************************************************
Shows and hides the submenus
********************************************************************************/

function evOut(){
        if(ie)this.style.visibility='hidden'
        else if(n) this.visibility='hidden'
}
//Canceling event bubbling in ie
function ieShow(num){
        if(ie){
                oSub[num].showIt()
                window.event.cancelBubble=true
        }
}
function extract(num){
        if(hideAll){
                for(i=0;i<oSub.length;i++){
                        if(num!=i) oSub[i].hideIt()
                }
        }
        oSub[num].showIt();
}
onload=menuBarInit;


</script>
</head>
<body bgcolor="#000000">
<div id="divBg">
<div id="divBgColor"></div>
  <div id="divTop0" class="clTop">[&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onmouseover="extract(0)">Link1</a>
    <div id="divSub0" class="clSub">
        <a href="test.html" onmouseover="ieShow(0)" onmouseout="ieShow(0)">Menulink 1</a><br>
        <a href="test.html" onmouseover="ieShow(0)" onmouseout="ieShow(0)">Menulink 2</a><br>
        <a href="test.html" onmouseover="ieShow(0)" onmouseout="ieShow(0)">Menulink 3</a><br>
        <br>
        </div>
    </div>
   
   
  <div id="divTop1" class="clTop">|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onmouseover="extract(1)">Link2</a>
    <div id="divSub1" class="clSub">
                  <a href="test.html" onmouseover="ieShow(1)" onmouseout="ieShow(1)">Menulink 1</a><br>
        <a href="test.html" onmouseover="ieShow(1)" onmouseout="ieShow(1)">Menulink 2</a><br>
        <a href="test.html" onmouseover="ieShow(1)" onmouseout="ieShow(1)">Menulink 3</a><br>
        <br>
        </div>
    </div>
   
   
  <div id="divTop2" class="clTop">|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onmouseover="extract(2)">Link3</a>
    <div id="divSub2" class="clSub">
              <a href="test.html" onmouseover="ieShow(2)" onmouseout="ieShow(2)">Menulink 1</a><br>
        <a href="test.html" onmouseover="ieShow(2)" onmouseout="ieShow(2)">Menulink 2</a><br>
        <a href="test.html" onmouseover="ieShow(2)" onmouseout="ieShow(2)">Menulink 3</a><br>
        <br>
        </div>
    </div>
   
   
  <div id="divTop3" class="clTop">|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onmouseover="extract(3)">Link4</a>
    <div id="divSub3" class="clSub">
              <a href="test.html" onmouseover="ieShow(3)" onmouseout="ieShow(3)">Menulink 1</a><br>
        <a href="test.html" onmouseover="ieShow(3)" onmouseout="ieShow(3)">Menulink 2</a><br>
        <a href="test.html" onmouseover="ieShow(3)" onmouseout="ieShow(3)">Menulink 3</a><br>
        <br>
        </div>
    </div>
   
   
  <div id="divTop4" class="clTop">|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onmouseover="extract(4)">Link5</a>
    <div id="divSub4" class="clSub">
              <a href="test.html" onmouseover="ieShow(4)" onmouseout="ieShow(4)">Menulink 1</a><br>
        <a href="test.html" onmouseover="ieShow(4)" onmouseout="ieShow(4)">Menulink 2</a><br>
        <a href="test.html" onmouseover="ieShow(4)" onmouseout="ieShow(4)">Menulink 3</a><br>
        <br>
        </div>
    </div>

   
  <div id="divTop5" class="clTop">|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onmouseover="extract(5)">Link6</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;]
    <div id="divSub5" class="clSub">
              <a href="test.html" onmouseover="ieShow(5)" onmouseout="ieShow(5)">Menulink 1</a><br>
        <a href="test.html" onmouseover="ieShow(5)" onmouseout="ieShow(5)">Menulink 2</a><br>
        <a href="test.html" onmouseover="ieShow(5)" onmouseout="ieShow(5)">Menulink 3</a><br>
        <br>
        </div>   
    </div>

   

</div>



</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