Mange tak for hjælpen.
Du ved vist at din menu ikke virker med netscape 6.0!
Venlig hilsen
Emil
Andreas Bjerregaard wrote:
> Dynamicdrive.com er en mulighed, men hvis det en menu som den jeg har har på
> min side,
www.david-beckham.com , så er koden her:
>
>
> <STYLE TYPE="text/css">
> <!--
> .menu { position:absolute;
> visibility:hidden;
> background-color: white;
> color: black;
> width: 80px;
> height: auto;
> border-style: solid;
> 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 = 21;
> document[menuID].left = offset;
> } else {
> document.all[menuID].style.pixelTop = 25;
> document.all[menuID].style.pixelLeft = offset;
> }
>
> 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=