Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mouse cursor change to finger in Netscape 4+

Status
Not open for further replies.

cturg1

IS-IT--Management
Aug 27, 2001
4
US
Currently we are implementing the Pop-up menus to our intranet site. The problem is with Netscape. In Explorer we can construct pop up menus that cause the mouse pointer to change into a finger, which indicate links. Although in Netscape the links are active but the pointer remains in its original state.We would like to know how to fix the problem of non-indication in Netscape? It turns to the finger on main links, but its the pop up links that don't seem activate the mouse cursor change. PLEASE CATER YOUR ANSWER TO WORK IN BOTH IE AND NETSCAPE BROWSERS 4 and above.
Here is the code:

----code starts under this line -------------

<html>
<head>
<title>Fireworks.gif</title>
<style>
td.rollover { cursor:pointer; cursor:hand; }
td.rollout { cursor:default; }
</style>

<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html;&quot;>
<!-- Fireworks 4.0 Dreamweaver 4.0 target. Created Tue Aug 21 16:02:00 GMT-0400 (Eastern Daylight Time) 2001-->
<script language=&quot;JavaScript&quot;>
<!--
function fwLoadMenus() {
if (window.fw_menu_0) return;
window.fw_menu_0 = new Menu(&quot;root&quot;,95,18,&quot;Verdana, Arial, Helvetica, sans-serif&quot;,11,&quot;#ff0000&quot;,&quot;#ff0000&quot;,&quot;#ffffff&quot;,&quot;#ffffff&quot;);
fw_menu_0.addMenuItem(&quot;Macromedia&quot;,&quot;location=' fw_menu_0.addMenuItem(&quot;Hotmail&quot;,&quot;location=' fw_menu_0.fontStyle=&quot;italic&quot;;
fw_menu_0.hideOnMouseOut=true;

fw_menu_0.writeMenus();
} // fwLoadMenus()

//-->
</script>
<script language=&quot;JavaScript1.2&quot; src=&quot;fw_menu.js&quot;></script>
</head>
<body topmargin=&quot;0&quot; leftmargin=&quot;0&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; bgcolor=&quot;#ffffff&quot;>
<script language=&quot;JavaScript1.2&quot;>fwLoadMenus();</script>
<table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; width=&quot;500&quot;>
<!-- fwtable fwsrc=&quot;Fireworks.png&quot; fwbase=&quot;Fireworks.gif&quot; fwstyle=&quot;Dreamweaver&quot; fwdocid = &quot;742308039&quot; fwnested=&quot;0&quot; -->
<tr>
<td><img src=&quot;spacer.gif&quot; width=&quot;88&quot; height=&quot;1&quot; border=&quot;0&quot;></td>
<td><img src=&quot;spacer.gif&quot; width=&quot;126&quot; height=&quot;1&quot; border=&quot;0&quot;></td>
<td><img src=&quot;spacer.gif&quot; width=&quot;286&quot; height=&quot;1&quot; border=&quot;0&quot;></td>
<td><img src=&quot;spacer.gif&quot; width=&quot;1&quot; height=&quot;1&quot; border=&quot;0&quot;></td>
</tr>

<tr>
<a name=&quot;Fireworks_r1_c1&quot;></a><td colspan=&quot;3&quot;><img name=&quot;Fireworks_r1_c1&quot; src=&quot;Fireworks_r1_c1.gif&quot; width=&quot;500&quot; height=&quot;136&quot; border=&quot;0&quot;></td>
<td><img src=&quot;spacer.gif&quot; width=&quot;1&quot; height=&quot;136&quot; border=&quot;0&quot;></td>
</tr>
<tr>
<td rowspan=&quot;2&quot;><img name=&quot;Fireworks_r2_c1&quot; src=&quot;Fireworks_r2_c1.gif&quot; width=&quot;88&quot; height=&quot;364&quot; border=&quot;0&quot;></td>
<td><a href=&quot;#&quot; onMouseOut=&quot;FW_startTimeout();&quot; onMouseOver=&quot;window.FW_showMenu(window.fw_menu_0,215,154);&quot; ><img name=&quot;Fireworks_r2_c2&quot; src=&quot;Fireworks_r2_c2.gif&quot; width=&quot;126&quot; height=&quot;40&quot; border=&quot;0&quot;></a></td>
<td rowspan=&quot;2&quot;><img name=&quot;Fireworks_r2_c3&quot; src=&quot;Fireworks_r2_c3.gif&quot; width=&quot;286&quot; height=&quot;364&quot; border=&quot;0&quot;></td>
<td><img src=&quot;spacer.gif&quot; width=&quot;1&quot; height=&quot;40&quot; border=&quot;0&quot;></td>
</tr>
<tr>
<td><img name=&quot;Fireworks_r3_c2&quot; src=&quot;Fireworks_r3_c2.gif&quot; width=&quot;126&quot; height=&quot;324&quot; border=&quot;0&quot;></td>
<td><img src=&quot;spacer.gif&quot; width=&quot;1&quot; height=&quot;324&quot; border=&quot;0&quot;></td>
</tr>
</table>
</body>
</html>
------Also this is the javascript code-------
/**
* fw_menu 24OCT2000 Version 4.0
* John Ahlquist, October 2000
* Copyright (c) 2000 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 &quot;AS IS,&quot; without a warranty of any kind.
*/
function Menu(label, mw, mh, fnt, fs, fclr, fhclr, bg, bgh) {
this.version = &quot;990702 [Menu; menu.js]&quot;;
this.type = &quot;Menu&quot;;
this.menuWidth = mw;
this.menuItemHeight = mh;
this.fontSize = fs||12;
this.fontWeight = &quot;plain&quot;;
this.fontFamily = fnt||&quot;arial,helvetica,verdana,sans-serif&quot;;
this.fontColor = fclr||&quot;#000000&quot;;
this.fontColorHilite = fhclr||&quot;#ffffff&quot;;
this.bgColor = &quot;#555555&quot;;
this.menuBorder = 0;
this.menuItemBorder = 0;
this.menuItemBgColor = bg||&quot;#cccccc&quot;;
this.menuLiteBgColor = &quot;#ffffff&quot;;
this.menuBorderBgColor = &quot;#777777&quot;;
this.menuHiliteBgColor = bgh||&quot;#000084&quot;;
this.menuContainerBgColor = &quot;#cccccc&quot;;
this.childMenuIcon = &quot;arrows.gif&quot;;
this.items = new Array();
this.actions = new Array();
this.childMenus = new Array();

this.hideOnMouseOut = true;

this.addMenuItem = addMenuItem;
this.addMenuSeparator = addMenuSeparator;
this.writeMenus = writeMenus;
this.FW_showMenu = FW_showMenu;
this.onMenuItemOver = onMenuItemOver;
this.onMenuItemAction = onMenuItemAction;
this.hideMenu = hideMenu;
this.hideChildMenu = hideChildMenu;

if (!window.menus) window.menus = new Array();
this.label = label || &quot;menuLabel&quot; + window.menus.length;
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 addMenuSeparator() {
this.items[this.items.length] = &quot;separator&quot;;
this.actions[this.actions.length] = &quot;&quot;;
this.menuItemBorder = 0;
}

// For NS6.
function FIND(item) {
if (document.all) return(document.all[item]);
if (document.getElementById) return(document.getElementById(item));
return(false);
}

function writeMenus(container) {
if (window.triedToWriteMenus) return;

if (!container && document.layers) {
window.delayWriteMenus = this.writeMenus;
var timer = setTimeout('delayWriteMenus()', 250);
container = new Layer(100);
clearTimeout(timer);
} else if (document.all || document.hasChildNodes) {
document.writeln('<SPAN ID=&quot;menuContainer&quot;></SPAN>');
container = FIND(&quot;menuContainer&quot;);
}

window.fwHideMenuTimer = null;
if (!container) return;
window.triedToWriteMenus = true;
container.isContainer = true;
container.menus = new Array();
for (var i=0; i<window.menus.length; i++)
container.menus = window.menus;
window.menus.length = 0;
var countMenus = 0;
var countItems = 0;
var top = 0;
var content = '';
var lrs = false;
var theStat = &quot;&quot;;
var tsc = 0;
if (document.layers) lrs = true;
for (var i=0; i<container.menus.length; i++, countMenus++) {
var menu = container.menus;
if (menu.bgImageUp) {
menu.menuBorder = 0;
menu.menuItemBorder = 0;
}
if (lrs) {
var menuLayer = new Layer(100, container);
var lite = new Layer(100, menuLayer);
lite.top = menu.menuBorder;
lite.left = menu.menuBorder;
var body = new Layer(100, lite);
body.top = menu.menuBorder;
body.left = menu.menuBorder;
} else {
content += ''+
'<DIV ID=&quot;menuLayer'+ countMenus +'&quot; STYLE=&quot;position:absolute;z-index:1;left:10;top:'+ (i * 100) +';visibility:hidden;&quot;>\n'+
' <DIV ID=&quot;menuLite'+ countMenus +'&quot; STYLE=&quot;position:absolute;z-index:1;left:'+ menu.menuBorder +';top:'+ menu.menuBorder +';visibility:hide;&quot; onMouseOut=&quot;mouseoutMenu();&quot;>\n'+
' <DIV ID=&quot;menuFg'+ countMenus +'&quot; STYLE=&quot;position:absolute;left:'+ menu.menuBorder +';top:'+ menu.menuBorder +';visibility:hide;&quot;>\n'+
'';
}
var x=i;
for (var i=0; i<menu.items.length; i++) {
var item = menu.items;
var childMenu = false;
var defaultHeight = menu.fontSize+6;
var defaultIndent = menu.fontSize;
if (item.label) {
item = item.label;
childMenu = true;
}
menu.menuItemHeight = menu.menuItemHeight || defaultHeight;
menu.menuItemIndent = menu.menuItemIndent || defaultIndent;
var itemProps = 'font-family:' + menu.fontFamily +';font-weight:' + menu.fontWeight + ';fontSize:' + menu.fontSize + ';';
if (menu.fontStyle) itemProps += 'font-style:' + menu.fontStyle + ';';
if (document.all)
itemProps += 'font-size:' + menu.fontSize + ';&quot; onMouseOver=&quot;onMenuItemOver(null,this);&quot; onClick=&quot;onMenuItemAction(null,this);';
else if (!document.layers) {
itemProps += 'font-size:' + menu.fontSize + 'px;'; // zilla wants 12px.
}
var l;
if (lrs) {
l = new Layer(800,body);
}
var dTag = '<DIV ID=&quot;menuItem'+ countItems +'&quot; STYLE=&quot;position:absolute;left:0;top:'+ (i * menu.menuItemHeight) +';'+ itemProps +'&quot;>';
var dClose = '</DIV>'
if (menu.bgImageUp) {
menu.menuBorder = 0;
menu.menuItemBorder = 0;
dTag = '<DIV ID=&quot;menuItem'+ countItems +'&quot; STYLE=&quot;background:url('+menu.bgImageUp+');position:absolute;left:0;top:'+ (i * menu.menuItemHeight) +';'+ itemProps +'&quot;>';
if (document.layers) {
dTag = '<LAYER BACKGROUND=&quot;'+menu.bgImageUp+'&quot; ID=&quot;menuItem'+ countItems +'&quot; TOP=&quot;'+ (i * menu.menuItemHeight) +'&quot; style=&quot;' + itemProps +'&quot;>';
dClose = '</LAYER>';
}
}
var textProps = 'position:absolute;left:' + menu.menuItemIndent + ';top:1;';
if (lrs) {
textProps +=itemProps;
dTag = &quot;&quot;;
dClose = &quot;&quot;;
}

var dText = '<DIV ID=&quot;menuItemText'+ countItems +'&quot; STYLE=&quot;' + textProps + 'color:'+ menu.fontColor +';&quot;>'+ item +' </DIV>\n<DIV ID=&quot;menuItemHilite'+ countItems +'&quot; STYLE=&quot;' + textProps + 'top:1;color:'+ menu.fontColorHilite +';visibility:hidden;&quot;>'+ item +' </DIV>';
if (item == &quot;separator&quot;) {
content += ( dTag + '<DIV ID=&quot;menuSeparator'+ countItems +'&quot; STYLE=&quot;position:absolute;left:1;top:2;&quot;></DIV>\n<DIV ID=&quot;menuSeparatorLite'+ countItems +'&quot; STYLE=&quot;position:absolute;left:1;top:2;&quot;></DIV>\n' + dClose);
} else if (childMenu) {
content += ( dTag + dText + '<DIV ID=&quot;childMenu'+ countItems +'&quot; STYLE=&quot;position:absolute;left:0;top:3;&quot;><IMG SRC=&quot;'+ menu.childMenuIcon +'&quot;></DIV>\n' + dClose);
} else {
content += ( dTag + dText + dClose);
}
if (lrs) {
l.document.open(&quot;text/html&quot;);
l.document.writeln(content);
l.document.close();
content = '';
theStat += &quot;-&quot;;
tsc++;
if (tsc > 50) {
tsc = 0;
theStat = &quot;&quot;;
}
status = theStat;
}
countItems++;
}
if (lrs) {
// focus layer
var focusItem = new Layer(100, body);
focusItem.visiblity=&quot;hidden&quot;;
focusItem.document.open(&quot;text/html&quot;);
focusItem.document.writeln(&quot; &quot;);
focusItem.document.close();
} else {
content += ' <DIV ID=&quot;focusItem'+ countMenus +'&quot; STYLE=&quot;position:absolute;left:0;top:0;visibility:hide;&quot; onClick=&quot;onMenuItemAction(null,this);&quot;> </DIV>\n';
content += ' </DIV>\n </DIV>\n</DIV>\n';
}
i=x;
}
if (document.layers) {
container.clip.width = window.innerWidth;
container.clip.height = window.innerHeight;
container.onmouseout = mouseoutMenu;
container.menuContainerBgColor = this.menuContainerBgColor;
for (var i=0; i<container.document.layers.length; i++) {
proto = container.menus;
var menu = container.document.layers;
container.menus.menuLayer = menu;
container.menus.menuLayer.Menu = container.menus;
container.menus.menuLayer.Menu.container = container;
var body = menu.document.layers[0].document.layers[0];
body.clip.width = proto.menuWidth || body.clip.width;
body.clip.height = proto.menuHeight || body.clip.height;
for (var n=0; n<body.document.layers.length-1; n++) {
var l = body.document.layers[n];
l.Menu = container.menus;
l.menuHiliteBgColor = proto.menuHiliteBgColor;
l.document.bgColor = proto.menuItemBgColor;
l.saveColor = proto.menuItemBgColor;
l.onmouseover = proto.onMenuItemOver;
l.onclick = proto.onMenuItemAction;
l.action = container.menus.actions[n];
l.focusItem = body.document.layers[body.document.layers.length-1];
l.clip.width = proto.menuWidth || body.clip.width + proto.menuItemIndent;
l.clip.height = proto.menuItemHeight || l.clip.height;
if (n>0) l.top = body.document.layers[n-1].top + body.document.layers[n-1].clip.height + proto.menuItemBorder;
l.hilite = l.document.layers[1];
if (proto.bgImageUp) l.background.src = proto.bgImageUp;
l.document.layers[1].isHilite = true;
if (l.document.layers[0].id.indexOf(&quot;menuSeparator&quot;) != -1) {
l.hilite = null;
l.clip.height -= l.clip.height / 2;
l.document.layers[0].document.bgColor = proto.bgColor;
l.document.layers[0].clip.width = l.clip.width -2;
l.document.layers[0].clip.height = 1;
l.document.layers[1].document.bgColor = proto.menuLiteBgColor;
l.document.layers[1].clip.width = l.clip.width -2;
l.document.layers[1].clip.height = 1;
l.document.layers[1].top = l.document.layers[0].top + 1;
} else if (l.document.layers.length > 2) {
l.childMenu = container.menus.items[n].menuLayer;
l.document.layers[2].left = l.clip.width -13;
l.document.layers[2].top = (l.clip.height / 2) -4;
l.document.layers[2].clip.left += 3;
l.Menu.childMenus[l.Menu.childMenus.length] = l.childMenu;
}
}
body.document.bgColor = proto.bgColor;
body.clip.width = l.clip.width +proto.menuBorder;
body.clip.height = l.top + l.clip.height +proto.menuBorder;
var focusItem = body.document.layers[n];
focusItem.clip.width = body.clip.width;
focusItem.Menu = l.Menu;
focusItem.top = -30;
focusItem.captureEvents(Event.MOUSEDOWN);
focusItem.onmousedown = onMenuItemDown;
menu.document.bgColor = proto.menuBorderBgColor;
var lite = menu.document.layers[0];
lite.document.bgColor = proto.menuLiteBgColor;
lite.clip.width = body.clip.width +1;
lite.clip.height = body.clip.height +1;
menu.clip.width = body.clip.width + (proto.menuBorder * 3) ;
menu.clip.height = body.clip.height + (proto.menuBorder * 3);
}
} else {
if ((!document.all) && (container.hasChildNodes)) {
container.innerHTML=content;
} else {
container.document.open(&quot;text/html&quot;);
container.document.writeln(content);
container.document.close();
}
if (!FIND(&quot;menuLayer0&quot;)) return;
var menuCount = 0;
for (var x=0; x<container.menus.length; x++) {
var menuLayer = FIND(&quot;menuLayer&quot; + x);
container.menus[x].menuLayer = &quot;menuLayer&quot; + x;
menuLayer.Menu = container.menus[x];
menuLayer.Menu.container = &quot;menuLayer&quot; + x;
menuLayer.style.zIndex = 1;
var s = menuLayer.style;
s.top = s.pixelTop = -300;
s.left = s.pixelLeft = -300;

var menu = container.menus[x];
menu.menuItemWidth = menu.menuWidth || menu.menuIEWidth || 140;
menuLayer.style.backgroundColor = menu.menuBorderBgColor;
var top = 0;
for (var i=0; i<container.menus[x].items.length; i++) {
var l = FIND(&quot;menuItem&quot; + menuCount);
l.Menu = container.menus[x];
if (l.addEventListener) { // ns6
l.style.width = menu.menuItemWidth;
l.style.height = menu.menuItemHeight;
l.style.top = top;
l.addEventListener(&quot;mouseover&quot;, onMenuItemOver, false);
l.addEventListener(&quot;click&quot;, onMenuItemAction, false);
l.addEventListener(&quot;mouseout&quot;, mouseoutMenu, false);
} else { //ie
l.style.pixelWidth = menu.menuItemWidth;
l.style.pixelHeight = menu.menuItemHeight;
l.style.pixelTop = top;
}
top = top + menu.menuItemHeight+menu.menuItemBorder;
l.style.fontSize = menu.fontSize;
l.style.backgroundColor = menu.menuItemBgColor;
l.style.visibility = &quot;inherit&quot;;
l.saveColor = menu.menuItemBgColor;
l.menuHiliteBgColor = menu.menuHiliteBgColor;
l.action = container.menus[x].actions;
l.hilite = FIND(&quot;menuItemHilite&quot; + menuCount);
l.focusItem = FIND(&quot;focusItem&quot; + x);
l.focusItem.style.pixelTop = l.focusItem.style.top = -30;
var childItem = FIND(&quot;childMenu&quot; + menuCount);
if (childItem) {
l.childMenu = container.menus[x].items.menuLayer;
childItem.style.pixelLeft = childItem.style.left = menu.menuItemWidth -11;
childItem.style.pixelTop = childItem.style.top =(menu.menuItemHeight /2) -4;
//childItem.style.pixelWidth = 30 || 7;
//childItem.style.clip = &quot;rect(0 7 7 3)&quot;;
l.Menu.childMenus[l.Menu.childMenus.length] = l.childMenu;
}
var sep = FIND(&quot;menuSeparator&quot; + menuCount);
if (sep) {
sep.style.clip = &quot;rect(0 &quot; + (menu.menuItemWidth - 3) + &quot; 1 0)&quot;;
sep.style.width = sep.style.pixelWidth = menu.menuItemWidth;
sep.style.backgroundColor = menu.bgColor;
sep = FIND(&quot;menuSeparatorLite&quot; + menuCount);
sep.style.clip = &quot;rect(1 &quot; + (menu.menuItemWidth - 3) + &quot; 2 0)&quot;;
sep.style.width = sep.style.pixelWidth = menu.menuItemWidth;
sep.style.backgroundColor = menu.menuLiteBgColor;
l.style.height = l.style.pixelHeight = menu.menuItemHeight/2;
l.isSeparator = true
top -= (menu.menuItemHeight - l.style.pixelHeight)
} else {
l.style.cursor = &quot;hand&quot;
}
menuCount++;
}
menu.menuHeight = top-1;
var lite = FIND(&quot;menuLite&quot; + x);
var s = lite.style;
s.height = s.pixelHeight = menu.menuHeight +(menu.menuBorder * 2);
s.width = s.pixelWidth = menu.menuItemWidth + (menu.menuBorder * 2);
s.backgroundColor = menu.menuLiteBgColor;

var body = FIND(&quot;menuFg&quot; + x);
s = body.style;
s.height = s.pixelHeight = menu.menuHeight + menu.menuBorder;
s.width = s.pixelWidth = menu.menuItemWidth + menu.menuBorder;
s.backgroundColor = menu.bgColor;

s = menuLayer.style;
s.width = s.pixelWidth = menu.menuItemWidth + (menu.menuBorder * 4);
s.height = s.pixelHeight = menu.menuHeight+(menu.menuBorder*4);
}
}
if (document.captureEvents) {
document.captureEvents(Event.MOUSEUP);
}
if (document.addEventListener) {
document.addEventListener(&quot;mouseup&quot;, onMenuItemOver, false);
}
if (document.layers && window.innerWidth) {
window.onresize = NS4resize;
window.NS4sIW = window.innerWidth;
window.NS4sIH = window.innerHeight;
}
document.onmouseup = mouseupMenu;
window.fwWroteMenu = true;
status = &quot;&quot;;
}

function NS4resize() {
if (NS4sIW < window.innerWidth ||
NS4sIW > window.innerWidth ||
NS4sIH > window.innerHeight ||
NS4sIH < window.innerHeight )
{
window.location.reload();
}
}

function onMenuItemOver(e, l) {
FW_clearTimeout();
l = l || this;
a = window.ActiveMenuItem;
if (document.layers) {
if (a) {
a.document.bgColor = a.saveColor;
if (a.hilite) a.hilite.visibility = &quot;hidden&quot;;
if (a.Menu.bgImageOver) {
a.background.src = a.Menu.bgImageUp;
}
a.focusItem.top = -100;
a.clicked = false;
}
if (l.hilite) {
l.document.bgColor = l.menuHiliteBgColor;
l.zIndex = 1;
l.hilite.visibility = &quot;inherit&quot;;
l.hilite.zIndex = 2;
l.document.layers[1].zIndex = 1;
l.focusItem.zIndex = this.zIndex +2;
}
if (l.Menu.bgImageOver) {
l.background.src = l.Menu.bgImageOver;
}
l.focusItem.top = this.top;
l.Menu.hideChildMenu(l);
} else if (l.style && l.Menu) {
if (a) {
a.style.backgroundColor = a.saveColor;
if (a.hilite) a.hilite.style.visibility = &quot;hidden&quot;;
if (a.Menu.bgImageUp) {
a.style.background = &quot;url(&quot; + a.Menu.bgImageUp +&quot;)&quot;;;
}
}
if (l.isSeparator) return;
l.style.backgroundColor = l.menuHiliteBgColor;
l.zIndex = 1; // magic IE 4.5 mac happy doohicky. jba
if (l.Menu.bgImageOver) {
l.style.background = &quot;url(&quot; + l.Menu.bgImageOver +&quot;)&quot;;
}
if (l.hilite) {
l.style.backgroundColor = l.menuHiliteBgColor;
l.hilite.style.visibility = &quot;inherit&quot;;
}
l.focusItem.style.top = l.focusItem.style.pixelTop = l.style.pixelTop;
l.focusItem.style.zIndex = l.zIndex +1;
l.Menu.hideChildMenu(l);
} else {
return; // not a menu - magic IE 4.5 mac happy doohicky. jba
}
window.ActiveMenuItem = l;
}

function onMenuItemAction(e, l) {
l = window.ActiveMenuItem;
if (!l) return;
hideActiveMenus();
if (l.action) {
eval(&quot;&quot; + l.action);
}
window.ActiveMenuItem = 0;
}

function FW_clearTimeout()
{
if (fwHideMenuTimer) clearTimeout(fwHideMenuTimer);
fwHideMenuTimer = null;
fwDHFlag = false;
}
function FW_startTimeout()
{
fwStart = new Date();
fwDHFlag = true;
fwHideMenuTimer = setTimeout(&quot;fwDoHide()&quot;, 1000);
}

function fwDoHide()
{
if (!fwDHFlag) return;
var elapsed = new Date() - fwStart;
if (elapsed < 1000) {
fwHideMenuTimer = setTimeout(&quot;fwDoHide()&quot;, 1100-elapsed);
return;
}
fwDHFlag = false;
hideActiveMenus();
window.ActiveMenuItem = 0;
}

function FW_showMenu(menu, x, y, child) {
if (!window.fwWroteMenu) return;
FW_clearTimeout();
if (document.layers) {
if (menu) {
var l = menu.menuLayer || menu;
l.left = 1;
l.top = 1;
hideActiveMenus();
if (this.visibility) l = this;
window.ActiveMenu = l;
} else {
var l = child;
}
if (!l) return;
for (var i=0; i<l.layers.length; i++) {
if (!l.layers.isHilite)
l.layers.visibility = &quot;inherit&quot;;
if (l.layers.document.layers.length > 0)
FW_showMenu(null, &quot;relative&quot;, &quot;relative&quot;, l.layers);
}
if (l.parentLayer) {
if (x != &quot;relative&quot;)
l.parentLayer.left = x || window.pageX || 0;
if (l.parentLayer.left + l.clip.width > window.innerWidth)
l.parentLayer.left -= (l.parentLayer.left + l.clip.width - window.innerWidth);
if (y != &quot;relative&quot;)
l.parentLayer.top = y || window.pageY || 0;
if (l.parentLayer.isContainer) {
l.Menu.xOffset = window.pageXOffset;
l.Menu.yOffset = window.pageYOffset;
l.parentLayer.clip.width = window.ActiveMenu.clip.width +2;
l.parentLayer.clip.height = window.ActiveMenu.clip.height +2;
if (l.parentLayer.menuContainerBgColor) l.parentLayer.document.bgColor = l.parentLayer.menuContainerBgColor;
}
}
l.visibility = &quot;inherit&quot;;
if (l.Menu) l.Menu.container.visibility = &quot;inherit&quot;;
} else if (FIND(&quot;menuItem0&quot;)) {
var l = menu.menuLayer || menu;
hideActiveMenus();
if (typeof(l) == &quot;string&quot;) {
l = FIND(l);
}
window.ActiveMenu = l;
var s = l.style;
s.visibility = &quot;inherit&quot;;
if (x != &quot;relative&quot;)
s.left = s.pixelLeft = x || (window.pageX + document.body.scrollLeft) || 0;
if (y != &quot;relative&quot;)
s.top = s.pixelTop = y || (window.pageY + document.body.scrollTop) || 0;
l.Menu.xOffset = document.body.scrollLeft;
l.Menu.yOffset = document.body.scrollTop;
}
if (menu) {
window.activeMenus[window.activeMenus.length] = l;
}
}

function onMenuItemDown(e, l) {
var a = window.ActiveMenuItem;
if (document.layers) {
if (a) {
a.eX = e.pageX;
a.eY = e.pageY;
a.clicked = true;
}
}
}

function mouseupMenu(e)
{
hideMenu(true, e);
hideActiveMenus();
return true;
}

function mouseoutMenu()
{
hideMenu(false, false);
return true;
}


function hideMenu(mouseup, e) {
var a = window.ActiveMenuItem;
if (a && document.layers) {
a.document.bgColor = a.saveColor;
a.focusItem.top = -30;
if (a.hilite) a.hilite.visibility = &quot;hidden&quot;;
if (mouseup && a.action && a.clicked && window.ActiveMenu) {
if (a.eX <= e.pageX+15 && a.eX >= e.pageX-15 && a.eY <= e.pageY+10 && a.eY >= e.pageY-10) {
setTimeout('window.ActiveMenu.Menu.onMenuItemAction();', 2);
}
}
a.clicked = false;
if (a.Menu.bgImageOver) {
a.background.src = a.Menu.bgImageUp;
}
} else if (window.ActiveMenu && FIND(&quot;menuItem0&quot;)) {
if (a) {
a.style.backgroundColor = a.saveColor;
if (a.hilite) a.hilite.style.visibility = &quot;hidden&quot;;
if (a.Menu.bgImageUp) {
a.style.background = &quot;url(&quot; + a.Menu.bgImageUp +&quot;)&quot;;;
}
}
}
if (!mouseup && window.ActiveMenu) {
if (window.ActiveMenu.Menu) {
if (window.ActiveMenu.Menu.hideOnMouseOut) {
FW_startTimeout();
}
return(true);
}
}
return(true);
}

function PxToNum(pxStr)
{ // pxStr == 27px, we want 27.
if (pxStr.length > 2) {
n = Number(pxStr.substr(0, pxStr.length-2));
return(n);
}
return(0);
}

function hideChildMenu(hcmLayer) {
FW_clearTimeout();
var l = hcmLayer;
for (var i=0; i < l.Menu.childMenus.length; i++) {
var theLayer = l.Menu.childMenus;
if (document.layers) {
theLayer.visibility = &quot;hidden&quot;;
} else {
theLayer = FIND(theLayer);
theLayer.style.visibility = &quot;hidden&quot;;
}
theLayer.Menu.hideChildMenu(theLayer);
}

if (l.childMenu) {
var childMenu = l.childMenu;
if (document.layers) {
l.Menu.FW_showMenu(null,null,null,childMenu.layers[0]);
childMenu.zIndex = l.parentLayer.zIndex +1;
childMenu.top = l.top + l.parentLayer.top + l.Menu.menuLayer.top + l.Menu.menuItemHeight/3;
if (childMenu.left + childMenu.clip.width > window.innerWidth) {
childMenu.left = l.parentLayer.left - childMenu.clip.width + l.Menu.menuLayer.left + 15;
l.Menu.container.clip.left -= childMenu.clip.width;
} else {
childMenu.left = l.parentLayer.left + l.parentLayer.clip.width + l.Menu.menuLayer.left -5;
}
var w = childMenu.clip.width+childMenu.left-l.Menu.container.clip.left;
if (w > l.Menu.container.clip.width)
l.Menu.container.clip.width = w;
var h = childMenu.clip.height+childMenu.top-l.Menu.container.clip.top;
if (h > l.Menu.container.clip.height) l.Menu.container.clip.height = h;
l.document.layers[1].zIndex = 0;
childMenu.visibility = &quot;inherit&quot;;
} else if (FIND(&quot;menuItem0&quot;)) {
childMenu = FIND(l.childMenu);
var menuLayer = FIND(l.Menu.menuLayer);
var s = childMenu.style;
s.zIndex = menuLayer.style.zIndex+1;
if (document.all) { // ie case.
s.pixelTop = l.style.pixelTop + menuLayer.style.pixelTop + l.Menu.menuItemHeight/3;
s.left = s.pixelLeft = (menuLayer.style.pixelWidth) + menuLayer.style.pixelLeft -5;
} else { // zilla case
var top = PxToNum(l.style.top) + PxToNum(menuLayer.style.top) + l.Menu.menuItemHeight/3;
var left = (PxToNum(menuLayer.style.width)) + PxToNum(menuLayer.style.left) -5;
s.top = top;
s.left = left;
}
childMenu.style.visibility = &quot;inherit&quot;;
} else {
return;
}
window.activeMenus[window.activeMenus.length] = childMenu;
}
}

function hideActiveMenus() {
if (!window.activeMenus) return;
for (var i=0; i < window.activeMenus.length; i++) {
if (!activeMenus) continue;
if (activeMenus.visibility && activeMenus.Menu) {
activeMenus.visibility = &quot;hidden&quot;;
activeMenus.Menu.container.visibility = &quot;hidden&quot;;
activeMenus.Menu.container.clip.left = 0;
} else if (activeMenus.style) {
var s = activeMenus.style;
s.visibility = &quot;hidden&quot;;
s.left = -200;
s.top = -200;
}
}
if (window.ActiveMenuItem) {
hideMenu(false, false);
}
window.activeMenus.length = 0;
}


If you need to contact me personally for the explanantion : my email is ndelaune@siac.com
 
hie cturg1
i've the same problem with my menu, u wont make cursor change trhu css in netscrap (at least in nn4x versions)

there r two ways for ya:
1. embed everything with links
2. make cursor urself (long & diffclt way) - i saw somewhere faqs on how to do that, but cant remember where for now.. may be i'll find it if u'r einterested..

good luck Victor
 
I would be interested.

Thank you for your response.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top