Avatar billede swasper Nybegynder
17. maj 2001 - 13:25 Der er 3 kommentarer og
1 løsning

Menu

Hejsa

Jeg har dette script der bliver brugt til en menu!

Problemet er blot at jeg lige pludselig ikke kan til føje flere knapper, som i kan se hvis i kører scriptet så virker de to nederste knapper ikke.

Jeg vil også gerne have det lavet sådan at jeg ikke skal bruge billeder til kanpperne, men i stedet tekst.

Er der nogen der kan ordne det ?


<html>
<head>
<LINK REL=\'STYLESHEET\' TYPE=\'text/css\' HREF=\'../styles/skole.css\'>
    <title>test</title>
<style>
<!-- 
a        { text-decoration: underline }
a:hover    { color: rgb(245,245,245); text-decoration: none }
#Aboutus    { visibility: hidden; z-index: 1 }
#Products    { visibility: hidden; z-index: 1 }
#Promotion    { visibility: hidden; z-index: 1 }
#Support    { visibility: hidden; z-index: 1 }
#Indsats    { visibility: hidden; z-index: 1 }
#Tilk        { visibility: hidden; z-index: 1 }
#Skolebib    { visibility: hidden; z-index: 1 }
#Ita        { visibility: hidden; z-index: 1 }
#Tilbud    { visibility: hidden; z-index: 1 }
#Telefon    { visibility: hidden; z-index: 1 }
#Links    { visibility: hidden; z-index: 1 }
.menus      { color: #666699; font-family: arial, helvetica, \'sans serif\'; font-size: 8pt;
              text-decoration: none }
.menus:hover { color: #ffffff; background-color: #043365; font-family:
              arial, helvetica, \'sans serif\'; font-size: 8pt;
              text-decoration: none }
select      { font-family: arial, verdana; font-size: 12px }
input.Small  { font-family: arial, verdana; font-size: 12px }
input        { font-family: arial, verdana; font-size: 12px }
input.Button { font-family: arial, verdana; font-size: 12px }
-->
</style>

<SCRIPT language=javascript>
// Courtesy of SimplytheBest.net (http://simplythebest.net/info/dhtml_scripts.html)
<!--
if (document.images)
{var imglist = new Array (
  \"aboutuson.jpg\"
,
\"productson.jpg\"
,
\"promoon.jpg\"
,
\"supporton.jpg\"
,
\"123.jpg\"
,
\"789.jpg\"
,
\"321.jpg\"
,
\"444.jpg\"
,
\"567.jpg\"
,
\"678.jpg\"
,
\"630.jpg\"

);
var imgs = new Array(); var count;
for (count=0; count<imglist.length; count++)
{imgs[count]=new Image(); imgs[count].src=imglist[count];}
}
function hilite(name,m)
{if (document.images)
{imgswap(name, imgs[m])}
}
function imgswap(i1,i2)
{if (document.images)
{var temp = i1.src; i1.src=i2.src; i2.src=temp;}
}
// -->
</SCRIPT>

<SCRIPT language=javascript>
// Courtesy of SimplytheBest.net (http://simplythebest.net/info/dhtml_scripts.html)
<!--
window.onerror = null;
var bName = navigator.appName;
var bVer = parseInt(navigator.appVersion);
var NS4 = (bName == \"Netscape\" && bVer >= 4);
var IE4 = (bName == \"Microsoft Internet Explorer\" && bVer >= 4);
var NS3 = (bName == \"Netscape\" && bVer < 4);
var IE3 = (bName == \"Microsoft Internet Explorer\" && bVer < 4);
var menuActive = 0
var menuOn = 0
var onLayer
var timeOn = null// LAYER SWITCHING CODE
if (NS4 || IE4) {
if (navigator.appName == \"Netscape\") {
layerStyleRef=\"layer.\";
layerRef=\"document.layers\";
styleSwitch=\"\";
}else{
layerStyleRef=\"layer.style.\";
layerRef=\"document.all\";
styleSwitch=\".style\";
}
}

// SHOW MENU
function showLayer(layerName){
if (NS4 || IE4) {
if (timeOn != null) {
clearTimeout(timeOn)
hideLayer(onLayer)
}
if (NS4 || IE4) {
eval(layerRef+\'[\"\'+layerName+\'\"]\'+styleSwitch+\'.visibility=\"visible\"\');
}
onLayer = layerName
}
}// HIDE MENU
function hideLayer(layerName){
if (menuActive == 0) {
if (NS4 || IE4) {
eval(layerRef+\'[\"\'+layerName+\'\"]\'+styleSwitch+\'.visibility=\"hidden\"\');
}
}
}// TIMER FOR BUTTON MOUSE OUT
function btnTimer() {
timeOn = setTimeout(\"btnOut()\",1000)
}// BUTTON MOUSE OUT
function btnOut(layerName) {
if (menuActive == 0) {
hideLayer(onLayer)
}
}// MENU MOUSE OVER
function menuOver(itemName) {
clearTimeout(timeOn)
menuActive = 1
}// MENU MOUSE OUT
function menuOut(itemName) {
menuActive = 0
timeOn = setTimeout(\"hideLayer(onLayer)\", 400)
}// -->
</SCRIPT>

</head>

<body>

<table border=0 width=360 height=400 cellspacing=0 cellpadding=0>
<tr>
  <td width=200>

<table border=0 width=200 height=50 bgcolor=red id=\'Aboutus\'>
<tr>
  <td><a class=\"menus\" href=\"http://planmagic.com\" onmouseout=\"menuOut(\'rollimg0\')\" onmouseover=\"menuOver(\'rollimg0\')\" target=\"_top\"><b>PlanMagic
                  Corporation</b></a></td>
</tr>
</table>

<table border=0 width=200 height=50 bgcolor=green id=\'Products\'>
<tr>
  <td></td>
</tr>
</table>

<table border=0 width=200 height=50 bgcolor=blue id=\'Promotion\'>
<tr>
  <td></td>
</tr>
</table>

<table border=0 width=200 height=50 bgcolor=orange id=\'Support\'>
<tr>
  <td></td>
</tr>
</table>

<table border=0 width=200 height=50 bgcolor=black id=\'Indsats\'>
<tr>
  <td></td>
</tr>
</table>

<table border=0 width=200 height=50 bgcolor=lime id=\'Tilk\'>
<tr>
  <td></td>
</tr>
</table>

<table border=0 width=200 height=50 bgcolor=cool id=\'Skolebib\'>
<tr>
  <td></td>
</tr>
</table>

<table border=0 width=200 height=50 bgcolor=gray id=\'Ita\'>
<tr>
  <td></td>
</tr>
</table>

<table border=0 width=200 height=50 bgcolor=braun id=\'Tilbud\'>
<tr>
  <td></td>
</tr>
</table>

<table border=0 width=200 height=50 bgcolor=purple id=\'Telefon\'>
<tr>
  <td></td>
</tr>
</table>

<table border=0 width=200 height=50 bgcolor=yellow id=\'Links\'>
<tr>
  <td></td>
</tr>
</table>

  </td>
  <td width=160>

<div align=\"right\">
              <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"#FFFFFF\">
                <tr>
                  <td>
                    <a class=\"bigmenus\" href=\"http://planmagic.com/products.html\" onmouseout=\"btnTimer(), hilite(document.aboutus,0)\" onmouseover=\"showLayer(\'Aboutus\'), hilite(document.aboutus,0)\"><img name=\"aboutus\" border=\"0\" src=\"dscript41/aboutus.jpg\" align=\"bottom\" width=\"80\" height=\"19\"></a><br>
              <a class=\"bigmenus\" href=\"http://planmagic.com/products.html\" onmouseout=\"btnTimer(), hilite(document.products,1)\" onmouseover=\"showLayer(\'Products\'), hilite(document.products,1)\"><img name=\"products\" border=\"0\" src=\"dscript41/products.jpg\" align=\"bottom\" width=\"80\" height=\"19\"></a><br>
                    <a class=\"bigmenus\" href=\"http://planmagic.com/products.html\" onmouseout=\"btnTimer(), hilite(document.promotion,2)\" onmouseover=\"showLayer(\'Promotion\'), hilite(document.promotion,2)\"><img name=\"promotion\" src=\"dscript41/promo.jpg\" border=\"0\" align=\"bottom\" width=\"80\" height=\"20\"></a><br>
                    <a class=\"bigmenus\" href=\"http://planmagic.com/support.html\" onmouseout=\"btnTimer(), hilite(document.support,3)\" onmouseover=\"showLayer(\'Support\'), hilite(document.support,3)\"><img name=\"support\" src=\"dscript41/support.jpg\" border=\"0\" align=\"bottom\" width=\"80\" height=\"19\"></a><br>
              <a class=\"bigmenus\" href=\"http://planmagic.com/support.html\" onmouseout=\"btnTimer(), hilite(document.indsats,4)\" onmouseover=\"showLayer(\'Indsats\'), hilite(document.indsats,4)\"><img name=\"indsats\" src=\"dscript41/support.jpg\" border=\"0\" align=\"bottom\" width=\"80\" height=\"19\"></a><br>
              <a class=\"bigmenus\" href=\"http://planmagic.com/support.html\" onmouseout=\"btnTimer(), hilite(document.tilk,5)\" onmouseover=\"showLayer(\'Tilk\'), hilite(document.tilk,5)\"><img name=\"tilk\" src=\"dscript41/suppor42t.jpg\" border=\"0\" align=\"bottom\" width=\"80\" height=\"19\"></a><br>
              <a class=\"bigmenus\" href=\"http://planmagic.com/support.html\" onmouseout=\"btnTimer(), hilite(document.skolebib,6)\" onmouseover=\"showLayer(\'Skolebib\'), hilite(document.skolebib,6)\"><img name=\"skolebib\" src=\"dscript41/suppor2t.jpg\" border=\"0\" align=\"bottom\" width=\"80\" height=\"19\"></a><br>
              <a class=\"bigmenus\" href=\"http://planmagic.com/support.html\" onmouseout=\"btnTimer(), hilite(document.ita,7)\" onmouseover=\"showLayer(\'Ita\'), hilite(document.ita,7)\"><img name=\"ita\" src=\"dscript41/su5ppor2t.jpg\" border=\"0\" align=\"bottom\" width=\"80\" height=\"19\"></a><br>
              <a class=\"bigmenus\" href=\"http://planmagic.com/support.html\" onmouseout=\"btnTimer(), hilite(document.tilbud,8)\" onmouseover=\"showLayer(\'Tilbud\'), hilite(document.tilbud,8)\"><img name=\"tilbud\" src=\"dscript41/sup6por2t.jpg\" border=\"0\" align=\"bottom\" width=\"80\" height=\"19\"></a><br>
              <a class=\"bigmenus\" href=\"http://planmagic.com/support.html\" onmouseout=\"btnTimer(), hilite(document.telefon,9)\" onmouseover=\"showLayer(\'telefon\'), hilite(document.telefon,9)\"><img name=\"telefon\" src=\"dscript41/sup6por62t.jpg\" border=\"0\" align=\"bottom\" width=\"80\" height=\"19\"></a><br>
              <a class=\"bigmenus\" href=\"http://planmagic.com/support.html\" onmouseout=\"btnTimer(), hilite(document.links,10)\" onmouseover=\"showLayer(\'links\'), hilite(document.links,10)\"><img name=\"links\" src=\"dscript41/sup62por62t.jpg\" border=\"0\" align=\"bottom\" width=\"80\" height=\"19\"></a><br>




                    </td>
                </tr>
              </table>
            </div>

<TABLE BORDER=0 WIDTH=160 HEIGHT=20 CELLSPACING=0 CELLPADDING=0 ID=\'INFO-HEAD\'>
<TR>
  <TD WIDTH=160 ALIGN=LEFT><A HREF=\'./forsiden.html\' STYLE=\'width: 100%\' CLASS=\'link-menu-bold\' TARGET=\'MAIN\' onmouseout=\"btnTimer(), hilite(document.aboutus,0)\" onmouseover=\"showLayer(\'Aboutus\'), hilite(document.aboutus,0)\">&nbsp;&nbsp;Forsiden</A></TD>
</TR>
</TABLE>

<TABLE BORDER=0 WIDTH=160 HEIGHT=1 CELLSPACING=0 CELLPADDING=0 ID=\'INFO-LINE\'>
<TR>
  <TD></TD>
</TR>
</TABLE>

<TABLE BORDER=0 WIDTH=160 HEIGHT=20 CELLSPACING=0 CELLPADDING=0 ID=\'INFO-HEAD\'>
<TR>
  <TD WIDTH=160 ALIGN=LEFT><A HREF=\'./forsiden.html\' STYLE=\'width: 100%\' CLASS=\'link-menu-bold\' TARGET=\'MAIN\' onmouseout=\"btnTimer(), hilite(document.products,1)\" onmouseover=\"showLayer(\'Products\'), hilite(document.products,1)\">&nbsp;&nbsp;Kalender</A></TD>
</TR>
</TABLE>

<TABLE BORDER=0 WIDTH=160 HEIGHT=1 CELLSPACING=0 CELLPADDING=0 ID=\'INFO-LINE\'>
<TR>
  <TD></TD>
</TR>
</TABLE>

<TABLE BORDER=0 WIDTH=160 HEIGHT=20 CELLSPACING=0 CELLPADDING=0 ID=\'INFO-HEAD\'>
<TR>
  <TD WIDTH=160 ALIGN=LEFT><A HREF=\'./forsiden.html\' STYLE=\'width: 100%\' CLASS=\'link-menu-bold\' TARGET=\'MAIN\' onmouseout=\"btnTimer(), hilite(document.promotion,2)\" onmouseover=\"showLayer(\'Promotion\'), hilite(document.promotion,2)\">&nbsp;&nbsp;Personale</A></TD>
</TR>
</TABLE>

<TABLE BORDER=0 WIDTH=160 HEIGHT=1 CELLSPACING=0 CELLPADDING=0 ID=\'INFO-LINE\'>
<TR>
  <TD></TD>
</TR>
</TABLE>

<TABLE BORDER=0 WIDTH=160 HEIGHT=20 CELLSPACING=0 CELLPADDING=0 ID=\'INFO-HEAD\'>
<TR>
  <TD WIDTH=160 ALIGN=LEFT><A HREF=\'./forsiden.html\' STYLE=\'width: 100%\' CLASS=\'link-menu-bold\' TARGET=\'MAIN\' onmouseout=\"btnTimer(), hilite(document.support,3)\" onmouseover=\"showLayer(\'Support\'), hilite(document.support,3)\">&nbsp;&nbsp;Bestyrelsen</A></TD>
</TR>
</TABLE>

<TABLE BORDER=0 WIDTH=160 HEIGHT=1 CELLSPACING=0 CELLPADDING=0 ID=\'INFO-LINE\'>
<TR>
  <TD></TD>
</TR>
</TABLE>

  </td>
</tr>
</table>


</body>
</html>

Avatar billede slim Nybegynder
17. maj 2001 - 13:40 #1
Hmm... jeg kan førsoge
vent lidt...
Avatar billede swasper Nybegynder
17. maj 2001 - 13:52 #2
slim >> Okay, jeg venter spændt :-)
Avatar billede jakoba Nybegynder
21. maj 2001 - 00:33 #3
oppe i din style havde du defineret disse to linier for de sidste to menypunkter:
#Telefon    { visibility: hidden; z-index: 1 }
#Links    { visibility: hidden; z-index: 1 }

men nede i tabellen i dine links brugte du
onmouseover=\"showLayer(\'telefon\')\"  // med lille t (ditto for links)

for at udskifte images med tekst erstatter du billedet med et <span med samme name= parameter. Samtidig fjernes kaldene til hilite i mouseover og i mouseout.
jeg har gjort det for det første og for de de 3 sidste links på siden:
http://hjem.get2net.dk/Jakob.Aggernaes/temp/exp73547.html

mvh JakobA
Avatar billede swasper Nybegynder
18. juni 2001 - 00:59 #4
fik selv løst problemet :-)
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