20. december 2000 - 09:06
Der er
10 kommentarer og
1 løsning
Menu på www.php.net
Er der nogen der har opskriften på de menuer, der er på bla. QuickRef knappen på PHP.net? Jeg skal bruge den eller noget lignende :o)
20. december 2000 - 09:44
#2
Nåja.. I know.. jeg sidder oxo og skiller koden ad nu, men hvis der nu var en, der allerede har gjort arbejdet, så slipper jeg :o)
20. december 2000 - 14:01
#6
Jowda.. det er en custom udgave af et script fra viewsource.dk:
<html>
<head>
<title>Testing</title>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">
<link rel=\"stylesheet\" href=\"style.css\" type=\"text/css\">
<link rel=\"stylesheet\" href=\"style.css\" type=\"text/css\">
<STYLE TYPE=\"text/css\">
<!--
.menu { position:absolute;
visibility:hidden;
background-color: white;
color: black;
width: 200px;
height: auto;
border-style: gradient;
border-color: black;
border-width: 2px;
padding: 2px;
font-size : 12px;
font-family: \"arial\", \"helvetica\";
font-weight: bold;
line-height: 16px;}
.menu A:hover {color: red;}
.menu A {text-decoration: none; color: black;}
-->
</style>
<SCRIPT language=\"javascript\">
//do browser detect stuff
var isNS = (navigator.appName == \"Netscape\");
var isMacIE = ( (navigator.userAgent.indexOf(\"IE 4\") > -1) && (navigator.userAgent.indexOf(\"Mac\") > -1) );
var layerRef = (isNS) ? \"document\" : \"document.all\";
var styleRef = (isNS) ? \"\" : \".style\";
var isDynamic = ( (document.layers || document.all) && !isMacIE );
var activeMenu = 0;
var finalClip;
function activateMenu(menuLayerRef, offset) {
if (isDynamic && activeMenu != menuLayerRef) {
if (activeMenu) hideMenu(\"menu\" + activeMenu);
menuID = \"menu\" + menuLayerRef;
activeMenu = menuLayerRef;
if (isNS) {
document[menuID].top = offset;
//This should be changed according to the size of your image
document[menuID].left = 90;
} else {
document.all[menuID].style.pixelTop = offset;
//This should be changed according to the size of your image
document.all[menuID].style.pixelLeft = 95;
}
showMenu(menuID)
}
if (isDynamic && !isNS) window.event.cancelBubble = true;
}
function showMenu(layerID) {
eval(layerRef + \'[\"\' + layerID + \'\"]\' + styleRef + \'.visibility = \"visible\"\');
}
function hideMenu(layerID) {
eval(layerRef + \'[\"\' + layerID + \'\"]\' + styleRef + \'.visibility = \"hidden\"\');
}
function killMenu(e) {
//check if theres a menu active
if (activeMenu) {
menuID = \"menu\" + activeMenu;
if (isNS) {
menuX1 = document[menuID].left;
menuX2 = menuX1 + document[menuID].clip.right;
menuY1 = document[menuID].top;
menuY2 = menuY1 + document[menuID].clip.bottom;
if (e.pageX < menuX1 || e.pageX > menuX2 || e.pageY > menuY2) {
hideMenu(menuID);
activeMenu = 0;
}
} else {
hideMenu(menuID);
activeMenu = 0;
}
}
}
function init() {
if (isDynamic) {
if (isNS) {
document.captureEvents(Event.MOUSEMOVE);
document.onmousemove = killMenu;
} else {
document.onmouseover = killMenu;
}
}
}
//This function is included just for demonstration
function popUp(moviePath, winName, xSize, Ysize) {
window.open(moviePath, winName, \"width=\" + xSize + \",height=\" + Ysize + \",directories=no,status=no,scrollbars=no,resize=no,menubar=no,toolbar=no,alwaysRaised=yes\" );
}
</script>
</head>
<body bgcolor=\"#FFFFFF\" text=\"#000000\" leftmargin=\"0\" topmargin=\"0\" background=\"grafik/bg.jpg\" onload=\"init();\">
<script language=\"javascript1.2\">
if (isDynamic) {
document.write(\"<DIV id=menu0 class=menu onMouseover=activateMenu(1,200);>Dette er en test af menu nummer 0 med tekst og ingen links.. :o)</DIV>\");
document.write(\"<DIV id=menu1 class=menu onMouseover=activateMenu(1,200);>Dette er en test af menu nummer 1 med tekst og ingen links.. Yada Yada Yada Yada Yada Yada Yada</DIV>\");
document.write(\"<DIV id=menu2 class=menu onMouseover=activateMenu(2,300);>Dette er en test af menu nummer 2 med tekst og ingen links</DIV>\");
document.write(\"<DIV id=menu3 class=menu onMouseover=activateMenu(3,400);>Dette er en test af menu nummer 3 med tekst og ingen links</DIV>\");
document.write(\"<DIV id=menu4 class=menu onMouseover=activateMenu(3,400);>Dette er en test af menu nummer 4 med tekst og ingen links.. .. .. ..</DIV>\");
}
</script>
<table width=\"769\" border=\"0\" align=\"center\">
<tr>
<td height=\"85\" width=\"72\" bgcolor=\"#999999\">
<div align=\"center\"><a href=\"java script:popUp(\'#\', \'menu0\', 150, 200)\" onmouseover=\"activateMenu(0,50)\" ><img src=\"psd/temp/1.jpg\" width=\"72\" height=\"82\"></A></div>
</td>
<td width=\"617\" rowspan=\"4\" valign=\"top\">
<table width=\"99%\" border=\"0\" align=\"center\" cellspacing=\"0\">
<tr>
<td height=\"36\" width=\"4%\" valign=\"bottom\"><img src=\"grafik/england.jpg\" width=\"25\" height=\"13\"></td>
<td height=\"36\" width=\"91%\"><img src=\"grafik/menu_stor.jpg\" width=\"550\" height=\"33\"></td>
<td height=\"36\" width=\"5%\" valign=\"bottom\"><img src=\"grafik/danmark.jpg\" width=\"25\" height=\"13\"></td>
</tr>
</table>
<br>
<table border=\"0\" align=\"center\">
<tr>
<td height=\"270\" valign=\"bottom\"><img src=\"grafik/logo.jpg\" width=\"425\" height=\"227\"></td>
</tr>
</table>
</td>
<td height=\"85\" width=\"66\" bgcolor=\"#999999\">
<div align=\"center\"><img src=\"psd/temp/5.jpg\" width=\"72\" height=\"82\"></div>
</td>
</tr>
<tr>
<td height=\"85\" width=\"72\" bgcolor=\"#999999\">
<div align=\"center\"><a href=\"java script:popUp(\'#\', \'menu1\', 150, 200)\" onmouseover=\"activateMenu(1,90)\" ><img src=\"psd/temp/10.jpg\" width=\"72\" height=\"82\"></A></div>
</td>
<td height=\"85\" width=\"66\" bgcolor=\"#999999\">
<div align=\"center\"><img src=\"psd/temp/6.jpg\" width=\"72\" height=\"82\"></div>
</td>
</tr>
<tr>
<td height=\"85\" width=\"72\" bgcolor=\"#999999\">
<div align=\"center\"><a href=\"java script:popUp(\'#\', \'menu2\', 150, 200)\" onmouseover=\"activateMenu(2,180)\" ><img src=\"psd/temp/2.jpg\" width=\"72\" height=\"82\"></A></div>
</td>
<td height=\"85\" width=\"66\" bgcolor=\"#999999\">
<div align=\"center\"><img src=\"psd/temp/7.jpg\" width=\"72\" height=\"82\"></div>
</td>
</tr>
<tr>
<td height=\"60\" width=\"72\" bgcolor=\"#999999\">
<div align=\"center\"><a href=\"java script:popUp(\'#\', \'menu3\', 150, 200)\" onmouseover=\"activateMenu(3,270)\" ><img src=\"psd/temp/3.jpg\" width=\"72\" height=\"82\"></A></div>
</td>
<td height=\"60\" width=\"66\" bgcolor=\"#999999\">
<div align=\"center\"><img src=\"psd/temp/8.jpg\" width=\"72\" height=\"82\"></div>
</td>
</tr>
<tr>
<td height=\"2\" width=\"72\" bgcolor=\"#999999\">
<div align=\"center\"><a href=\"java script:popUp(\'#\', \'menu4\', 150, 200)\" onmouseover=\"activateMenu(4,350)\" ><img src=\"psd/temp/4.jpg\" width=\"72\" height=\"82\"></A></div>
</td>
<td width=\"617\" valign=\"bottom\" height=\"2\">
<table width=\"90%\" border=\"0\" align=\"center\">
<tr>
<td bgcolor=\"#FFFFFF\" height=\"39\">
<div align=\"center\"><font size=\"5\"><b>Banner</b></font></div>
</td>
</tr>
</table>
</td>
<td height=\"2\" width=\"66\" bgcolor=\"#999999\">
<div align=\"center\"><img src=\"psd/temp/9.jpg\" width=\"72\" height=\"82\"></div>
</td>
</tr>
</table>
</body>
</html>