Avatar billede snuseren.dk Nybegynder
20. marts 2003 - 19:55 Der er 5 kommentarer og
1 løsning

Højreklik menu, som adore.dk ??

Hej.

Hvor kan jeg finde en menu, der kommer når man højreklikker, på www.adore.dk ??

(Vidste ik om jeg sku have oprettet det i javascript menuen ??)

MVH
Anders
Avatar billede schaefner Juniormester
20. marts 2003 - 19:58 #1
Hvis du kopierer kildekoden fra siden så har du menuen.
Avatar billede snuseren.dk Nybegynder
20. marts 2003 - 20:00 #2
har prøvet, men får fejl i bunden af skærmen...

Mit ser sådan ud, jeg kan ikke se, at der skulle mangle noi, fra det andet script:

<html>
<head>
<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

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

NOTE: This menu have some "small" bugs.
In Netscape the links in the submenus will work even though the
submenus are hidden, this has something to do with
a lousy implementation of the relative positioning in Netscape.
In IE links "underneath" the submenus will not work even though the
submenus are hidden.
I will look into this and might find a fix for it.
********************************************************************************/


/********************************************************************************
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; this.vis=b_vis                       
    if(ie && vis) this.css.visibility='hidden'
    this.state=1
    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"
}
function b_vis(){
    if(this.css.visibility=="hidden" || this.css.visibility=="hide") return true;
}
/********************************************************************************
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()
    //Change it here if you want more or less submenus.
    oSub[0]=new makeMenuBar('divSub0','divBg',1)
    oSub[1]=new makeMenuBar('divSub1','divBg',1)
    oSub[2]=new makeMenuBar('divSub2','divBg',1)
    oSub[3]=new makeMenuBar('divSub3','divBg',1)
    oSub[4]=new makeMenuBar('divSub4','divBg',1)
    //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 extract(num){
    if(hideAll){
        for(i=0;i<oSub.length;i++){
            if(num!=i) oSub[i].hideIt()
        }
    }
    !oSub[num].vis()?oSub[num].hideIt():oSub[num].showIt();

}

onload=menuBarInit;
</script>

</head>

<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  <TBODY>
  <TR>
    <TD width="33%">&nbsp;</TD>
    <TD width="34%">
      <TABLE cellSpacing=0 cellPadding=0 width="700" border=0>
        <TBODY>
        <TR>
              <TD width="700" height="100" background="gfx/top.gif"><table width="700" height="100" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td width="502">&nbsp;</td>
                    <td height="45" width="220">
                   
                   
                    <script>
//<!--
var dayName = new Array("S&oslash;ndag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "L&oslash;rdag");
var monthName = new Array("Januar", "Februar", "Marts", "April", "Maj", "Juni", "Juli", "August", "September", "Oktober", "November", "December");
var date = new Date();
var year = date.getYear();
if (year < 1900)
year += 1900;
document.write(dayName[date.getDay()] + " den " + date.getDate() + ". " + monthName[date.getMonth()] + " " + year + "<br>")
//-->
                    </script>


&nbsp;</td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                  </tr>
                </table></TD>
            </TR>
        <TR>
          <TD bgcolor="ffffff">


<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

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

NOTE: This menu have some "small" bugs.
In Netscape the links in the submenus will work even though the
submenus are hidden, this has something to do with
a lousy implementation of the relative positioning in Netscape.
In IE links "underneath" the submenus will not work even though the
submenus are hidden.
I will look into this and might find a fix for it.
********************************************************************************/


/********************************************************************************
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; this.vis=b_vis                       
    if(ie && vis) this.css.visibility='hidden'
    this.state=1
    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"
}
function b_vis(){
    if(this.css.visibility=="hidden" || this.css.visibility=="hide") return true;
}
/********************************************************************************
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()
    //Change it here if you want more or less submenus.
    oSub[0]=new makeMenuBar('divSub0','divBg',1)
    oSub[1]=new makeMenuBar('divSub1','divBg',1)
    oSub[2]=new makeMenuBar('divSub2','divBg',1)
    oSub[3]=new makeMenuBar('divSub3','divBg',1)
    oSub[4]=new makeMenuBar('divSub4','divBg',1)
    //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 extract(num){
    if(hideAll){
        for(i=0;i<oSub.length;i++){
            if(num!=i) oSub[i].hideIt()
        }
    }
    !oSub[num].vis()?oSub[num].hideIt():oSub[num].showIt();

}

onload=menuBarInit;
</script>

sdjhs

<DIV id=ie5menu onclick=jumptoie5() onmouseout=lowlightie5()
onmouseover=highlightie5()>
<DIV class=menuitems url="java script:history.back()">Tilbage</DIV>
<DIV class=menuitems url="java script:history.forward()">Frem</DIV>
<DIV class=menuitems url="java script:location.reload()">Opdater</DIV>
<DIV class=menuitems
url="java script:window.external.AddFavorite('http://www.adore.dk', 'Adore.dk - Thomas Dalsgaard Clausen')">Tilføj til foretrukne</DIV>
<DIV class=menuitems
onclick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.adore.dk')">Adore.dk som startside</DIV>
<DIV class=menuitems url="mailto:admin@adore.dk">Skriv en e-mail til mig</DIV></DIV>
<STYLE>A:hover {
    COLOR: #FFFFFF
}
A:visited {
    COLOR: #000000; TEXT-DECORATION: none
}
A:active {
    COLOR: #000000; TEXT-DECORATION: none
}
A:link {
    COLOR: #000000; TEXT-DECORATION: none
}
A:hover {
    COLOR: #FFFFFF; TEXT-DECORATION: none
}
#ie5menu {
    BACKGROUND-COLOR: #c0c0c0; BORDER-BOTTOM: black 1px solid; BORDER-LEFT: black 1px solid; BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; CURSOR: default; FILTER: alpha(opacity=80); FONT-FAMILY: Tahoma; FONT-SIZE: 10px; LINE-HEIGHT: 12px; POSITION: absolute; VISIBILITY: hidden; WIDTH: 80px; Z-INDEX: 99; font-color: #000000
}
.menuitems {
    PADDING-BOTTOM: 5px; PADDING-LEFT: 5px; PADDING-RIGHT: 5px; PADDING-TOP: 5px; font-color: #000000
}
</STYLE>

<SCRIPT language=JavaScript1.2>var display_url=0



function showmenuie5(){

ie5menu.style.left=document.body.scrollLeft+event.clientX

ie5menu.style.top=document.body.scrollTop+event.clientY

ie5menu.style.visibility="visible"

return false

}



function hidemenuie5(){

ie5menu.style.visibility="hidden"

}



function highlightie5(){

if (event.srcElement.className=="menuitems"){

event.srcElement.style.backgroundColor="#666666"

event.srcElement.style.color="black"

if (display_url==1)

window.status=event.srcElement.url

}

}



function lowlightie5(){

if (event.srcElement.className=="menuitems"){

event.srcElement.style.backgroundColor=""

event.srcElement.style.color="black"

window.status=''

}

}



function jumptoie5(){

if (event.srcElement.className=="menuitems")

window.location=event.srcElement.url

}</SCRIPT>

<SCRIPT language=JavaScript1.2>document.oncontextmenu=showmenuie5

if (document.all&&window.print)

document.body.onclick=hidemenuie5</SCRIPT>


</body>
</html>
Avatar billede cdc Novice
20. marts 2003 - 20:07 #3
har renset lidt ud:

<html>

<head>
<title></title>
<STYLE>A:hover {
    COLOR: #FFFFFF
}
A:visited {
    COLOR: #000000; TEXT-DECORATION: none
}
A:active {
    COLOR: #000000; TEXT-DECORATION: none
}
A:link {
    COLOR: #000000; TEXT-DECORATION: none
}
A:hover {
    COLOR: #FFFFFF; TEXT-DECORATION: none
}
#ie5menu {
    BACKGROUND-COLOR: #c0c0c0; BORDER-BOTTOM: black 1px solid; BORDER-LEFT: black 1px solid; BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; CURSOR: default; FILTER: alpha(opacity=80); FONT-FAMILY: Tahoma; FONT-SIZE: 10px; LINE-HEIGHT: 12px; POSITION: absolute; VISIBILITY: hidden; WIDTH: 80px; Z-INDEX: 99; font-color: #000000
}
.menuitems {
    PADDING-BOTTOM: 5px; PADDING-LEFT: 5px; PADDING-RIGHT: 5px; PADDING-TOP: 5px; font-color: #000000
}
</STYLE>

</head>

<body>
<DIV id=ie5menu onclick=jumptoie5() onmouseout=lowlightie5()
onmouseover=highlightie5()>
<DIV class=menuitems url="java script:history.back()">Tilbage</DIV>
<DIV class=menuitems url="java script:history.forward()">Frem</DIV>
<DIV class=menuitems url="java script:location.reload()">Opdater</DIV>
<DIV class=menuitems
url="java script:window.external.AddFavorite('http://www.adore.dk', 'Adore.dk - Thomas Dalsgaard Clausen')">Tilføj til foretrukne</DIV>
<DIV class=menuitems
onclick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.adore.dk')">Adore.dk som startside</DIV>
<DIV class=menuitems url="mailto:admin@adore.dk">Skriv en e-mail til mig</DIV></DIV>

<SCRIPT language=JavaScript1.2>var display_url=0



function showmenuie5(){

ie5menu.style.left=document.body.scrollLeft+event.clientX

ie5menu.style.top=document.body.scrollTop+event.clientY

ie5menu.style.visibility="visible"

return false

}



function hidemenuie5(){

ie5menu.style.visibility="hidden"

}



function highlightie5(){

if (event.srcElement.className=="menuitems"){

event.srcElement.style.backgroundColor="#666666"

event.srcElement.style.color="black"

if (display_url==1)

window.status=event.srcElement.url

}

}



function lowlightie5(){

if (event.srcElement.className=="menuitems"){

event.srcElement.style.backgroundColor=""

event.srcElement.style.color="white"

window.status=''

}

}



function jumptoie5(){

if (event.srcElement.className=="menuitems")

window.location=event.srcElement.url

}</SCRIPT>

<SCRIPT language=JavaScript1.2>document.oncontextmenu=showmenuie5

if (document.all&&window.print)

document.body.onclick=hidemenuie5</SCRIPT> <br>

</body>

</html>
Avatar billede snuseren.dk Nybegynder
20. marts 2003 - 20:11 #4
/cdc det virker jo perfekt !! :-) Lægger du ik lige et svar ??
Avatar billede cdc Novice
20. marts 2003 - 20:14 #5
svarer :o)
Avatar billede cdc Novice
20. marts 2003 - 20:17 #6
takker
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
Vi tilbyder markedets bedste kurser inden for webudvikling

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