Backgroundimage in mm-menu.js

Remme

Erfahrenes Mitglied
Hallo liebe Javaspezialisten,

ich habe eine DropDown_menü über die mm_menu.js in eine Homepage eingebaut hat auch alles wunderbar geklappt, aber ich hätte gerne ein Hintergrundbild statt nur einer Farbe.

am besten sieht man es direkt auf der Internetseite http://www.etix-esports.de

Die mm_menu.js (Auschnitt)

Code:
/**
 * mm_menu 20MAR2002 Version 6.0
 * Andy Finnell, March 2002
 * Copyright (c) 2000-2002 Macromedia, Inc.
 *
 * based on menu.js
 * by gary smith, July 1997
 * Copyright (c) 1997-1999 Netscape Communications Corp.
 *
 * Netscape grants you a royalty free license to use or modify this
 * software provided that this copyright notice appears on all copies.
 * This software is provided "AS IS," without a warranty of any kind.
 */
function Menu(label, mw, mh, fnt, fs, fclr, fhclr, bg, bgh, halgn, valgn, pad, space, to, sx, sy, srel, opq, vert, idt, aw, ah) 
{
	this.version = "020320 [Menu; mm_menu.js]";
	this.type = "Menu";
	this.menuWidth = mw;
	this.menuItemHeight = mh;
	this.fontSize = fs;
	this.fontWeight = "plain";
	this.fontFamily = fnt;
	this.fontColor = fclr;
	this.fontColorHilite = fhclr;
	this.bgColor = "#555555";
	this.menuBorder = 1;
	this.menuBgOpaque=opq;
	this.menuItemBorder = 1;
	this.menuItemIndent = idt;
	this.menuItemBgColor = bg;
	this.menuItemVAlign = valgn;
	this.menuItemHAlign = halgn;
	this.menuItemPadding = pad;
	this.menuItemSpacing = space;
	this.menuLiteBgColor = "#ffffff";
	this.menuBorderBgColor = "#777777";
	this.menuHiliteBgColor = bgh;
	this.menuContainerBgColor = "#cccccc";
	this.childMenuIcon = "arrows.gif";
	this.submenuXOffset = sx;
	this.submenuYOffset = sy;
	this.submenuRelativeToItem = srel;
	this.vertical = vert;
	this.items = new Array();
	this.actions = new Array();
	this.childMenus = new Array();
	this.hideOnMouseOut = true;
	this.hideTimeout = to;
	this.addMenuItem = addMenuItem;
	this.writeMenus = writeMenus;
	this.MM_showMenu = MM_showMenu;
	this.onMenuItemOver = onMenuItemOver;
	this.onMenuItemAction = onMenuItemAction;
	this.hideMenu = hideMenu;
	this.hideChildMenu = hideChildMenu;
	if (!window.menus) window.menus = new Array();
	this.label = " " + label;
	window.menus[this.label] = this;
	window.menus[window.menus.length] = this;
	if (!window.activeMenus) window.activeMenus = new Array();
}

function addMenuItem(label, action) {
	this.items[this.items.length] = label;
	this.actions[this.actions.length] = action;
}

function FIND(item) {
	if( window.mmIsOpera ) return(document.getElementById(item));
	if (document.all) return(document.all[item]);
	if (document.getElementById) return(document.getElementById(item));
	return(false);
}

function writeMenus(container) {
	if (window.triedToWriteMenus) return;
	var agt = navigator.userAgent.toLowerCase();
	window.mmIsOpera = agt.indexOf("opera") != -1;
	if (!container && document.layers) {
		window.delayWriteMenus = this.writeMenus;
		var timer = setTimeout('delayWriteMenus()', 500);
		container = new Layer(100);
		clearTimeout(timer);
	} else if (document.all || document.hasChildNodes || window.mmIsOpera) {
		document.writeln('<span id="menuContainer"></span>');
		container = FIND("menuContainer");
	}

und so ist es in der Seite eingebaut

zwischen head und /head (Auschnitt)

Code:
<SCRIPT type=text/JavaScript>
<!--
function mmLoadMenus() {
  if (window.mm_menu_1005171959_0) return;
     
 window.mm_menu_1202003438_0 = new Menu("root",144,15,"Arial, Helvetica, sans-serif",11,"#ffffff","#FFFFFF","#3232ff","#7b7bff","left","middle",3,0,1000,-5,7,true,false,true,0,false,true);
  mm_menu_1202003438_0.addMenuItem("News","location='index.php?site=news&action=news'");
  mm_menu_1202003438_0.addMenuItem("Newsarchive","location='index.php?site=news&action=archive'");
  mm_menu_1202003438_0.addMenuItem("Awards","location='index.php?site=awards'");
  mm_menu_1202003438_0.addMenuItem("Events","location='index.php?site=calendar'");
   mm_menu_1202003438_0.hideOnMouseOut=true;
   mm_menu_1202003438_0.bgColor='#555555';
   mm_menu_1202003438_0.menuBorder=1;
   mm_menu_1202003438_0.menuLiteBgColor='#FFFFFF';
   mm_menu_1202003438_0.menuBorderBgColor='#CCCCCC';


mm_menu_1202010127_0.writeMenus();
} // mmLoadMenus()

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</SCRIPT>

<SCRIPT language=JavaScript src="mm_menu.js"></SCRIPT>

beim Button

Code:
<IMG id=image1 
                  onmouseover="MM_showMenu(window.mm_menu_1202003438_0,70,44,null,'image1')" 
                  onmouseout=MM_startTimeout(); height=44 
                  src="Bilder/etix_02.jpg" width=215 
                  name=image1></TD>

und statt der blauen Hintergrundfarbe würde ich gerne ein Bild einfügen. Nur wo muss ich das einsetzen.

Hoffe es ist verständlich was ich meine im notfall einfach mal auf die Seite gehen und im Quelltext schauen.

mfg Remme
 
Zuletzt bearbeitet:

Neue Beiträge

Zurück