Fireworks pop up

Κώδικας, πληροφορίες, ερωτήσεις και απαντήσεις σχετικές με την JavaScript.

Συντονιστές: WebDev Moderators, Super-Moderators

Απάντηση
dimar
Δημοσιεύσεις: 1
Εγγραφή: 18 Μάιος 2005 19:06

Fireworks pop up

Δημοσίευση από dimar » 18 Μάιος 2005 19:21

Exv dhmiourghsei ena pop up menu me to Fireworks kai tha hthela na epeksergastv to mm_menu.js etsi vste to link na anoigei se ena neo window xvris ta elements tou browser

sas stelnv kai ton kvdika tou .js

Κώδικας: Επιλογή όλων

/**
* 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&#40;'<span id="menuContainer"></span>'&#41;;
container = FIND&#40;"menuContainer"&#41;;
&#125;

window.mmHideMenuTimer = null;
if &#40;!container&#41; return;
window.triedToWriteMenus = true;
container.isContainer = true;
container.menus = new Array&#40;&#41;;
for &#40;var i=0; i<window.menus.length; i++&#41;
container.menus&#91;i&#93; = window.menus&#91;i&#93;;
window.menus.length = 0;
var countMenus = 0;
var countItems = 0;
var top = 0;
var content = '';
var lrs = false;
var theStat = "";
var tsc = 0;
if &#40;document.layers&#41; lrs = true;
for &#40;var i=0; i<container.menus.length; i++, countMenus++&#41; &#123;
var menu = container.menus&#91;i&#93;;
if &#40;menu.bgImageUp || !menu.menuBgOpaque&#41; &#123;
menu.menuBorder = 0;
menu.menuItemBorder = 0;
&#125;
if &#40;lrs&#41; &#123;
var menuLayer = new Layer&#40;100, container&#41;;
var lite = new Layer&#40;100, menuLayer&#41;;
lite.top = menu.menuBorder;
lite.left = menu.menuBorder;
var body = new Layer&#40;100, lite&#41;;
body.top = menu.menuBorder;
body.left = menu.menuBorder;
&#125; else &#123;
content += ''+
'<div id="menuLayer'+ countMenus +'" style="position&#58;absolute;z-index&#58;1;left&#58;10px;top&#58;'+ &#40;i * 100&#41; +'px;visibility&#58;hidden;color&#58;' + menu.menuBorderBgColor + ';">\n'+
' <div id="menuLite'+ countMenus +'" style="position&#58;absolute;z-index&#58;1;left&#58;'+ menu.menuBorder +'px;top&#58;'+ menu.menuBorder +'px;visibility&#58;hide;" onmouseout="mouseoutMenu&#40;&#41;;">\n'+
' <div id="menuFg'+ countMenus +'" style="position&#58;absolute;left&#58;'+ menu.menuBorder +'px;top&#58;'+ menu.menuBorder +'px;visibility&#58;hide;">\n'+
'';
&#125;
var x=i;
for &#40;var i=0; i<menu.items.length; i++&#41; &#123;
var item = menu.items&#91;i&#93;;
var childMenu = false;
var defaultHeight = menu.fontSize+2*menu.menuItemPadding;
if &#40;item.label&#41; &#123;
item = item.label;
childMenu = true;
&#125;
menu.menuItemHeight = menu.menuItemHeight || defaultHeight;
var itemProps = '';
if&#40; menu.fontFamily != '' &#41; itemProps += 'font-family&#58;' + menu.fontFamily +';';
itemProps += 'font-weight&#58;' + menu.fontWeight + ';fontSize&#58;' + menu.fontSize + 'px;';
if &#40;menu.fontStyle&#41; itemProps += 'font-style&#58;' + menu.fontStyle + ';';
if &#40;document.all || window.mmIsOpera&#41;
itemProps += 'font-size&#58;' + menu.fontSize + 'px;" onmouseover="onMenuItemOver&#40;null,this&#41;;" onclick="onMenuItemAction&#40;null,this&#41;;';
else if &#40;!document.layers&#41; &#123;
itemProps += 'font-size&#58;' + menu.fontSize + 'px;';
&#125;
var l;
if &#40;lrs&#41; &#123;
var lw = menu.menuWidth;
if&#40; menu.menuItemHAlign == 'right' &#41; lw -= menu.menuItemPadding;
l = new Layer&#40;lw,body&#41;;
&#125;
var itemLeft = 0;
var itemTop = i*menu.menuItemHeight;
if&#40; !menu.vertical &#41; &#123;
itemLeft = i*menu.menuWidth;
itemTop = 0;
&#125;
var dTag = '<div id="menuItem'+ countItems +'" style="position&#58;absolute;left&#58;' + itemLeft + 'px;top&#58;'+ itemTop +'px;'+ itemProps +'">';
var dClose = '</div>'
if &#40;menu.bgImageUp&#41; dTag = '<div id="menuItem'+ countItems +'" style="background&#58;url&#40;'+menu.bgImageUp+'&#41;;position&#58;absolute;left&#58;' + itemLeft + 'px;top&#58;'+ itemTop +'px;'+ itemProps +'">';

var left = 0, top = 0, right = 0, bottom = 0;
left = 1 + menu.menuItemPadding + menu.menuItemIndent;
right = left + menu.menuWidth - 2*menu.menuItemPadding - menu.menuItemIndent;
if&#40; menu.menuItemVAlign == 'top' &#41; top = menu.menuItemPadding;
if&#40; menu.menuItemVAlign == 'bottom' &#41; top = menu.menuItemHeight-menu.fontSize-1-menu.menuItemPadding;
if&#40; menu.menuItemVAlign == 'middle' &#41; top = &#40;&#40;menu.menuItemHeight/2&#41;-&#40;menu.fontSize/2&#41;-1&#41;;
bottom = menu.menuItemHeight - 2*menu.menuItemPadding;
var textProps = 'position&#58;absolute;left&#58;' + left + 'px;top&#58;' + top + 'px;';
if &#40;lrs&#41; &#123;
textProps +=itemProps + 'right&#58;' + right + ';bottom&#58;' + bottom + ';';
dTag = "";
dClose = "";
&#125;

if&#40;document.all && !window.mmIsOpera&#41; &#123;
item = '<div align="' + menu.menuItemHAlign + '">' + item + '</div>';
&#125; else if &#40;lrs&#41; &#123;
item = '<div style="text-align&#58;' + menu.menuItemHAlign + ';">' + item + '</div>';
&#125; else &#123;
var hitem = null;
if&#40; menu.menuItemHAlign != 'left' &#41; &#123;
if&#40;window.mmIsOpera&#41; &#123;
var operaWidth = menu.menuItemHAlign == 'center' ? -&#40;menu.menuWidth-2*menu.menuItemPadding&#41; &#58; &#40;menu.menuWidth-6*menu.menuItemPadding&#41;;
hitem = '<div id="menuItemHilite' + countItems + 'Shim" style="position&#58;absolute;top&#58;1px;left&#58;' + menu.menuItemPadding + 'px;width&#58;' + operaWidth + 'px;text-align&#58;'
+ menu.menuItemHAlign + ';visibility&#58;visible;">' + item + '</div>';
item = '<div id="menuItemText' + countItems + 'Shim" style="position&#58;absolute;top&#58;1px;left&#58;' + menu.menuItemPadding + 'px;width&#58;' + operaWidth + 'px;text-align&#58;'
+ menu.menuItemHAlign + ';visibility&#58;visible;">' + item + '</div>';
&#125; else &#123;
hitem = '<div id="menuItemHilite' + countItems + 'Shim" style="position&#58;absolute;top&#58;1px;left&#58;1px;right&#58;-' + &#40;left+menu.menuWidth-3*menu.menuItemPadding&#41; + 'px;text-align&#58;'
+ menu.menuItemHAlign + ';visibility&#58;visible;">' + item + '</div>';
item = '<div id="menuItemText' + countItems + 'Shim" style="position&#58;absolute;top&#58;1px;left&#58;1px;right&#58;-' + &#40;left+menu.menuWidth-3*menu.menuItemPadding&#41; + 'px;text-align&#58;'
+ menu.menuItemHAlign + ';visibility&#58;visible;">' + item + '</div>';
&#125;
&#125; else hitem = null;
&#125;
if&#40;document.all && !window.mmIsOpera&#41; item = '<div id="menuItemShim' + countItems + '" style="position&#58;absolute;left&#58;0px;top&#58;0px;">' + item + '</div>';
var dText = '<div id="menuItemText'+ countItems +'" style="' + textProps + 'color&#58;'+ menu.fontColor +';">'+ item +'&nbsp</div>\n'
+ '<div id="menuItemHilite'+ countItems +'" style="' + textProps + 'color&#58;'+ menu.fontColorHilite +';visibility&#58;hidden;">'
+ &#40;hitem||item&#41; +'&nbsp</div>';
if &#40;childMenu&#41; content += &#40; dTag + dText + '<div id="childMenu'+ countItems +'" style="position&#58;absolute;left&#58;0px;top&#58;3px;"><img src="'+ menu.childMenuIcon +'"></div>\n' + dClose&#41;;
else content += &#40; dTag + dText + dClose&#41;;
if &#40;lrs&#41; &#123;
l.document.open&#40;"text/html"&#41;;
l.document.writeln&#40;content&#41;;
l.document.close&#40;&#41;;
content = '';
theStat += "-";
tsc++;
if &#40;tsc > 50&#41; &#123;
tsc = 0;
theStat = "";
&#125;
status = theStat;
&#125;
countItems++;
&#125;
if &#40;lrs&#41; &#123;
var focusItem = new Layer&#40;100, body&#41;;
focusItem.visiblity="hidden";
focusItem.document.open&#40;"text/html"&#41;;
focusItem.document.writeln&#40;"&nbsp;"&#41;;
focusItem.document.close&#40;&#41;;
&#125; else &#123;
content += ' <div id="focusItem'+ countMenus +'" style="position&#58;absolute;left&#58;0px;top&#58;0px;visibility&#58;hide;" onclick="onMenuItemAction&#40;null,this&#41;;">&nbsp;</div>\n';
content += ' </div>\n </div>\n</div>\n';
&#125;
i=x;
&#125;
if &#40;document.layers&#41; &#123;
container.clip.width = window.innerWidth;
container.clip.height = window.innerHeight;
container.onmouseout = mouseoutMenu;
container.menuContainerBgColor = this.menuContainerBgColor;
for &#40;var i=0; i<container.document.layers.length; i++&#41; &#123;
proto = container.menus&#91;i&#93;;
var menu = container.document.layers&#91;i&#93;;
container.menus&#91;i&#93;.menuLayer = menu;
container.menus&#91;i&#93;.menuLayer.Menu = container.menus&#91;i&#93;;
container.menus&#91;i&#93;.menuLayer.Menu.container = container;
var body = menu.document.layers&#91;0&#93;.document.layers&#91;0&#93;;
body.clip.width = proto.menuWidth || body.clip.width;
body.clip.height = proto.menuHeight || body.clip.height;
for &#40;var n=0; n<body.document.layers.length-1; n++&#41; &#123;
var l = body.document.layers&#91;n&#93;;
l.Menu = container.menus&#91;i&#93;;
l.menuHiliteBgColor = proto.menuHiliteBgColor;
l.document.bgColor = proto.menuItemBgColor;
l.saveColor = proto.menuItemBgColor;
l.onmouseover = proto.onMenuItemOver;
l.onclick = proto.onMenuItemAction;
l.mmaction = container.menus&#91;i&#93;.actions&#91;n&#93;;
l.focusItem = body.document.layers&#91;body.document.layers.length-1&#93;;
l.clip.width = proto.menuWidth || body.clip.width;
l.clip.height = proto.menuItemHeight || l.clip.height;
if &#40;n>0&#41; &#123;
if&#40; l.Menu.vertical &#41; l.top = body.document.layers&#91;n-1&#93;.top + body.document.layers&#91;n-1&#93;.clip.height + proto.menuItemBorder + proto.menuItemSpacing;
else l.left = body.document.layers&#91;n-1&#93;.left + body.document.layers&#91;n-1&#93;.clip.width + proto.menuItemBorder + proto.menuItemSpacing;
&#125;
l.hilite = l.document.layers&#91;1&#93;;
if &#40;proto.bgImageUp&#41; l.background.src = proto.bgImageUp;
l.document.layers&#91;1&#93;.isHilite = true;
if &#40;l.document.layers.length > 2&#41; &#123;
l.childMenu = container.menus&#91;i&#93;.items&#91;n&#93;.menuLayer;
l.document.layers&#91;2&#93;.left = l.clip.width -13;
l.document.layers&#91;2&#93;.top = &#40;l.clip.height / 2&#41; -4;
l.document.layers&#91;2&#93;.clip.left += 3;
l.Menu.childMenus&#91;l.Menu.childMenus.length&#93; = l.childMenu;
&#125;
&#125;
if&#40; proto.menuBgOpaque &#41; body.document.bgColor = proto.bgColor;
if&#40; proto.vertical &#41; &#123;
body.clip.width = l.clip.width +proto.menuBorder;
body.clip.height = l.top + l.clip.height +proto.menuBorder;
&#125; else &#123;
body.clip.height = l.clip.height +proto.menuBorder;
body.clip.width = l.left + l.clip.width +proto.menuBorder;
if&#40; body.clip.width > window.innerWidth &#41; body.clip.width = window.innerWidth;
&#125;
var focusItem = body.document.layers&#91;n&#93;;
focusItem.clip.width = body.clip.width;
focusItem.Menu = l.Menu;
focusItem.top = -30;
focusItem.captureEvents&#40;Event.MOUSEDOWN&#41;;
focusItem.onmousedown = onMenuItemDown;
if&#40; proto.menuBgOpaque &#41; menu.document.bgColor = proto.menuBorderBgColor;
var lite = menu.document.layers&#91;0&#93;;
if&#40; proto.menuBgOpaque &#41; 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 + &#40;proto.menuBorder * 3&#41; ;
menu.clip.height = body.clip.height + &#40;proto.menuBorder * 3&#41;;
&#125;
&#125; else &#123;
if &#40;&#40;!document.all&#41; && &#40;container.hasChildNodes&#41; && !window.mmIsOpera&#41; &#123;
container.innerHTML=content;
&#125; else &#123;
container.document.open&#40;"text/html"&#41;;
container.document.writeln&#40;content&#41;;
container.document.close&#40;&#41;;
&#125;
if &#40;!FIND&#40;"menuLayer0"&#41;&#41; return;
var menuCount = 0;
for &#40;var x=0; x<container.menus.length; x++&#41; &#123;
var menuLayer = FIND&#40;"menuLayer" + x&#41;;
container.menus&#91;x&#93;.menuLayer = "menuLayer" + x;
menuLayer.Menu = container.menus&#91;x&#93;;
menuLayer.Menu.container = "menuLayer" + x;
menuLayer.style.zindex = 1;
var s = menuLayer.style;
s.pixeltop = -300;
s.pixelleft = -300;
s.top = '-300px';
s.left = '-300px';

var menu = container.menus&#91;x&#93;;
menu.menuItemWidth = menu.menuWidth || menu.menuIEWidth || 140;
if&#40; menu.menuBgOpaque &#41; menuLayer.style.backgroundColor = menu.menuBorderBgColor;
var top = 0;
var left = 0;
menu.menuItemLayers = new Array&#40;&#41;;
for &#40;var i=0; i<container.menus&#91;x&#93;.items.length; i++&#41; &#123;
var l = FIND&#40;"menuItem" + menuCount&#41;;
l.Menu = container.menus&#91;x&#93;;
l.Menu.menuItemLayers&#91;l.Menu.menuItemLayers.length&#93; = l;
if &#40;l.addEventListener || window.mmIsOpera&#41; &#123;
l.style.width = menu.menuItemWidth + 'px';
l.style.height = menu.menuItemHeight + 'px';
l.style.pixelWidth = menu.menuItemWidth;
l.style.pixelHeight = menu.menuItemHeight;
l.style.top = top + 'px';
l.style.left = left + 'px';
if&#40;l.addEventListener&#41; &#123;
l.addEventListener&#40;"mouseover", onMenuItemOver, false&#41;;
l.addEventListener&#40;"click", onMenuItemAction, false&#41;;
l.addEventListener&#40;"mouseout", mouseoutMenu, false&#41;;
&#125;
if&#40; menu.menuItemHAlign != 'left' &#41; &#123;
l.hiliteShim = FIND&#40;"menuItemHilite" + menuCount + "Shim"&#41;;
l.hiliteShim.style.visibility = "inherit";
l.textShim = FIND&#40;"menuItemText" + menuCount + "Shim"&#41;;
l.hiliteShim.style.pixelWidth = menu.menuItemWidth - 2*menu.menuItemPadding - menu.menuItemIndent;
l.hiliteShim.style.width = l.hiliteShim.style.pixelWidth;
l.textShim.style.pixelWidth = menu.menuItemWidth - 2*menu.menuItemPadding - menu.menuItemIndent;
l.textShim.style.width = l.textShim.style.pixelWidth;
&#125;
&#125; else &#123;
l.style.pixelWidth = menu.menuItemWidth;
l.style.pixelHeight = menu.menuItemHeight;
l.style.pixelTop = top;
l.style.pixelLeft = left;
if&#40; menu.menuItemHAlign != 'left' &#41; &#123;
var shim = FIND&#40;"menuItemShim" + menuCount&#41;;
shim&#91;0&#93;.style.pixelWidth = menu.menuItemWidth - 2*menu.menuItemPadding - menu.menuItemIndent;
shim&#91;1&#93;.style.pixelWidth = menu.menuItemWidth - 2*menu.menuItemPadding - menu.menuItemIndent;
shim&#91;0&#93;.style.width = shim&#91;0&#93;.style.pixelWidth + 'px';
shim&#91;1&#93;.style.width = shim&#91;1&#93;.style.pixelWidth + 'px';
&#125;
&#125;
if&#40; menu.vertical &#41; top = top + menu.menuItemHeight+menu.menuItemBorder+menu.menuItemSpacing;
else left = left + menu.menuItemWidth+menu.menuItemBorder+menu.menuItemSpacing;
l.style.fontSize = menu.fontSize + 'px';
l.style.backgroundColor = menu.menuItemBgColor;
l.style.visibility = "inherit";
l.saveColor = menu.menuItemBgColor;
l.menuHiliteBgColor = menu.menuHiliteBgColor;
l.mmaction = container.menus&#91;x&#93;.actions&#91;i&#93;;
l.hilite = FIND&#40;"menuItemHilite" + menuCount&#41;;
l.focusItem = FIND&#40;"focusItem" + x&#41;;
l.focusItem.style.pixelTop = -30;
l.focusItem.style.top = '-30px';
var childItem = FIND&#40;"childMenu" + menuCount&#41;;
if &#40;childItem&#41; &#123;
l.childMenu = container.menus&#91;x&#93;.items&#91;i&#93;.menuLayer;
childItem.style.pixelLeft = menu.menuItemWidth -11;
childItem.style.left = childItem.style.pixelLeft + 'px';
childItem.style.pixelTop = &#40;menu.menuItemHeight /2&#41; -4;
childItem.style.top = childItem.style.pixelTop + 'px';
l.Menu.childMenus&#91;l.Menu.childMenus.length&#93; = l.childMenu;
&#125;
l.style.cursor = "hand";
menuCount++;
&#125;
if&#40; menu.vertical &#41; &#123;
menu.menuHeight = top-1-menu.menuItemSpacing;
menu.menuWidth = menu.menuItemWidth;
&#125; else &#123;
menu.menuHeight = menu.menuItemHeight;
menu.menuWidth = left-1-menu.menuItemSpacing;
&#125;

var lite = FIND&#40;"menuLite" + x&#41;;
var s = lite.style;
s.pixelHeight = menu.menuHeight +&#40;menu.menuBorder * 2&#41;;
s.height = s.pixelHeight + 'px';
s.pixelWidth = menu.menuWidth + &#40;menu.menuBorder * 2&#41;;
s.width = s.pixelWidth + 'px';
if&#40; menu.menuBgOpaque &#41; s.backgroundColor = menu.menuLiteBgColor;

var body = FIND&#40;"menuFg" + x&#41;;
s = body.style;
s.pixelHeight = menu.menuHeight + menu.menuBorder;
s.height = s.pixelHeight + 'px';
s.pixelWidth = menu.menuWidth + menu.menuBorder;
s.width = s.pixelWidth + 'px';
if&#40; menu.menuBgOpaque &#41; s.backgroundColor = menu.bgColor;

s = menuLayer.style;
s.pixelWidth = menu.menuWidth + &#40;menu.menuBorder * 4&#41;;
s.width = s.pixelWidth + 'px';
s.pixelHeight = menu.menuHeight+&#40;menu.menuBorder*4&#41;;
s.height = s.pixelHeight + 'px';
&#125;
&#125;
if &#40;document.captureEvents&#41; document.captureEvents&#40;Event.MOUSEUP&#41;;
if &#40;document.addEventListener&#41; document.addEventListener&#40;"mouseup", onMenuItemOver, false&#41;;
if &#40;document.layers && window.innerWidth&#41; &#123;
window.onresize = NS4resize;
window.NS4sIW = window.innerWidth;
window.NS4sIH = window.innerHeight;
setTimeout&#40;"NS4resize&#40;&#41;",500&#41;;
&#125;
document.onmouseup = mouseupMenu;
window.mmWroteMenu = true;
status = "";
&#125;

function NS4resize&#40;&#41; &#123;
if &#40;NS4sIW != window.innerWidth || NS4sIH != window.innerHeight&#41; window.location.reload&#40;&#41;;
&#125;

function onMenuItemOver&#40;e, l&#41; &#123;
MM_clearTimeout&#40;&#41;;
l = l || this;
var a = window.ActiveMenuItem;
if &#40;document.layers&#41; &#123;
if &#40;a&#41; &#123;
a.document.bgColor = a.saveColor;
if &#40;a.hilite&#41; a.hilite.visibility = "hidden";
if &#40;a.Menu.bgImageOver&#41; a.background.src = a.Menu.bgImageUp;
a.focusItem.top = -100;
a.clicked = false;
&#125;
if &#40;l.hilite&#41; &#123;
l.document.bgColor = l.menuHiliteBgColor;
l.zIndex = 1;
l.hilite.visibility = "inherit";
l.hilite.zIndex = 2;
l.document.layers&#91;1&#93;.zIndex = 1;
l.focusItem.zIndex = this.zIndex +2;
&#125;
if &#40;l.Menu.bgImageOver&#41; l.background.src = l.Menu.bgImageOver;
l.focusItem.top = this.top;
l.focusItem.left = this.left;
l.focusItem.clip.width = l.clip.width;
l.focusItem.clip.height = l.clip.height;
l.Menu.hideChildMenu&#40;l&#41;;
&#125; else if &#40;l.style && l.Menu&#41; &#123;
if &#40;a&#41; &#123;
a.style.backgroundColor = a.saveColor;
if &#40;a.hilite&#41; a.hilite.style.visibility = "hidden";
if &#40;a.hiliteShim&#41; a.hiliteShim.style.visibility = "inherit";
if &#40;a.Menu.bgImageUp&#41; a.style.background = "url&#40;" + a.Menu.bgImageUp +"&#41;";;
&#125;
l.style.backgroundColor = l.menuHiliteBgColor;
l.zIndex = 1;
if &#40;l.Menu.bgImageOver&#41; l.style.background = "url&#40;" + l.Menu.bgImageOver +"&#41;";
if &#40;l.hilite&#41; &#123;
l.hilite.style.visibility = "inherit";
if&#40; l.hiliteShim &#41; l.hiliteShim.style.visibility = "visible";
&#125;
l.focusItem.style.pixelTop = l.style.pixelTop;
l.focusItem.style.top = l.focusItem.style.pixelTop + 'px';
l.focusItem.style.pixelLeft = l.style.pixelLeft;
l.focusItem.style.left = l.focusItem.style.pixelLeft + 'px';
l.focusItem.style.zIndex = l.zIndex +1;
l.Menu.hideChildMenu&#40;l&#41;;
&#125; else return;
window.ActiveMenuItem = l;
&#125;

function onMenuItemAction&#40;e, l&#41; &#123;
l = window.ActiveMenuItem;
if &#40;!l&#41; return;
hideActiveMenus&#40;&#41;;
if &#40;l.mmaction&#41; eval&#40;"" + l.mmaction&#41;;
window.ActiveMenuItem = 0;
&#125;

function MM_clearTimeout&#40;&#41; &#123;
if &#40;mmHideMenuTimer&#41; clearTimeout&#40;mmHideMenuTimer&#41;;
mmHideMenuTimer = null;
mmDHFlag = false;
&#125;

function MM_startTimeout&#40;&#41; &#123;
if&#40; window.ActiveMenu &#41; &#123;
mmStart = new Date&#40;&#41;;
mmDHFlag = true;
mmHideMenuTimer = setTimeout&#40;"mmDoHide&#40;&#41;", window.ActiveMenu.Menu.hideTimeout&#41;;
&#125;
&#125;

function mmDoHide&#40;&#41; &#123;
if &#40;!mmDHFlag || !window.ActiveMenu&#41; return;
var elapsed = new Date&#40;&#41; - mmStart;
var timeout = window.ActiveMenu.Menu.hideTimeout;
if &#40;elapsed < timeout&#41; &#123;
mmHideMenuTimer = setTimeout&#40;"mmDoHide&#40;&#41;", timeout+100-elapsed&#41;;
return;
&#125;
mmDHFlag = false;
hideActiveMenus&#40;&#41;;
window.ActiveMenuItem = 0;
&#125;

function MM_showMenu&#40;menu, x, y, child, imgname&#41; &#123;
if &#40;!window.mmWroteMenu&#41; return;
MM_clearTimeout&#40;&#41;;
if &#40;menu&#41; &#123;
var obj = FIND&#40;imgname&#41; || document.images&#91;imgname&#93; || document.links&#91;imgname&#93; || document.anchors&#91;imgname&#93;;
x = moveXbySlicePos &#40;x, obj&#41;;
y = moveYbySlicePos &#40;y, obj&#41;;
&#125;
if &#40;document.layers&#41; &#123;
if &#40;menu&#41; &#123;
var l = menu.menuLayer || menu;
l.top = l.left = 1;
hideActiveMenus&#40;&#41;;
if &#40;this.visibility&#41; l = this;
window.ActiveMenu = l;
&#125; else &#123;
var l = child;
&#125;
if &#40;!l&#41; return;
for &#40;var i=0; i<l.layers.length; i++&#41; &#123;
if &#40;!l.layers&#91;i&#93;.isHilite&#41; l.layers&#91;i&#93;.visibility = "inherit";
if &#40;l.layers&#91;i&#93;.document.layers.length > 0&#41; MM_showMenu&#40;null, "relative", "relative", l.layers&#91;i&#93;&#41;;
&#125;
if &#40;l.parentLayer&#41; &#123;
if &#40;x != "relative"&#41; l.parentLayer.left = x || window.pageX || 0;
if &#40;l.parentLayer.left + l.clip.width > window.innerWidth&#41; l.parentLayer.left -= &#40;l.parentLayer.left + l.clip.width - window.innerWidth&#41;;
if &#40;y != "relative"&#41; l.parentLayer.top = y || window.pageY || 0;
if &#40;l.parentLayer.isContainer&#41; &#123;
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 &#40;l.parentLayer.menuContainerBgColor && l.Menu.menuBgOpaque &#41; l.parentLayer.document.bgColor = l.parentLayer.menuContainerBgColor;
&#125;
&#125;
l.visibility = "inherit";
if &#40;l.Menu&#41; l.Menu.container.visibility = "inherit";
&#125; else if &#40;FIND&#40;"menuItem0"&#41;&#41; &#123;
var l = menu.menuLayer || menu;
hideActiveMenus&#40;&#41;;
if &#40;typeof&#40;l&#41; == "string"&#41; l = FIND&#40;l&#41;;
window.ActiveMenu = l;
var s = l.style;
s.visibility = "inherit";
if &#40;x != "relative"&#41; &#123;
s.pixelLeft = x || &#40;window.pageX + document.body.scrollLeft&#41; || 0;
s.left = s.pixelLeft + 'px';
&#125;
if &#40;y != "relative"&#41; &#123;
s.pixelTop = y || &#40;window.pageY + document.body.scrollTop&#41; || 0;
s.top = s.pixelTop + 'px';
&#125;
l.Menu.xOffset = document.body.scrollLeft;
l.Menu.yOffset = document.body.scrollTop;
&#125;
if &#40;menu&#41; window.activeMenus&#91;window.activeMenus.length&#93; = l;
MM_clearTimeout&#40;&#41;;
&#125;

function onMenuItemDown&#40;e, l&#41; &#123;
var a = window.ActiveMenuItem;
if &#40;document.layers && a&#41; &#123;
a.eX = e.pageX;
a.eY = e.pageY;
a.clicked = true;
&#125;
&#125;

function mouseupMenu&#40;e&#41; &#123;
hideMenu&#40;true, e&#41;;
hideActiveMenus&#40;&#41;;
return true;
&#125;

function getExplorerVersion&#40;&#41; &#123;
var ieVers = parseFloat&#40;navigator.appVersion&#41;;
if&#40; navigator.appName != 'Microsoft Internet Explorer' &#41; return ieVers;
var tempVers = navigator.appVersion;
var i = tempVers.indexOf&#40; 'MSIE ' &#41;;
if&#40; i >= 0 &#41; &#123;
tempVers = tempVers.substring&#40; i+5 &#41;;
ieVers = parseFloat&#40; tempVers &#41;;
&#125;
return ieVers;
&#125;

function mouseoutMenu&#40;&#41; &#123;
if &#40;&#40;navigator.appName == "Microsoft Internet Explorer"&#41; && &#40;getExplorerVersion&#40;&#41; < 4.5&#41;&#41;
return true;
hideMenu&#40;false, false&#41;;
return true;
&#125;

function hideMenu&#40;mouseup, e&#41; &#123;
var a = window.ActiveMenuItem;
if &#40;a && document.layers&#41; &#123;
a.document.bgColor = a.saveColor;
a.focusItem.top = -30;
if &#40;a.hilite&#41; a.hilite.visibility = "hidden";
if &#40;mouseup && a.mmaction && a.clicked && window.ActiveMenu&#41; &#123;
if &#40;a.eX <= e.pageX+15 && a.eX >= e.pageX-15 && a.eY <= e.pageY+10 && a.eY >= e.pageY-10&#41; &#123;
setTimeout&#40;'window.ActiveMenu.Menu.onMenuItemAction&#40;&#41;;', 500&#41;;
&#125;
&#125;
a.clicked = false;
if &#40;a.Menu.bgImageOver&#41; a.background.src = a.Menu.bgImageUp;
&#125; else if &#40;window.ActiveMenu && FIND&#40;"menuItem0"&#41;&#41; &#123;
if &#40;a&#41; &#123;
a.style.backgroundColor = a.saveColor;
if &#40;a.hilite&#41; a.hilite.style.visibility = "hidden";
if &#40;a.hiliteShim&#41; a.hiliteShim.style.visibility = "inherit";
if &#40;a.Menu.bgImageUp&#41; a.style.background = "url&#40;" + a.Menu.bgImageUp +"&#41;";
&#125;
&#125;
if &#40;!mouseup && window.ActiveMenu&#41; &#123;
if &#40;window.ActiveMenu.Menu&#41; &#123;
if &#40;window.ActiveMenu.Menu.hideOnMouseOut&#41; MM_startTimeout&#40;&#41;;
return&#40;true&#41;;
&#125;
&#125;
return&#40;true&#41;;
&#125;

function hideChildMenu&#40;hcmLayer&#41; &#123;
MM_clearTimeout&#40;&#41;;
var l = hcmLayer;
for &#40;var i=0; i < l.Menu.childMenus.length; i++&#41; &#123;
var theLayer = l.Menu.childMenus&#91;i&#93;;
if &#40;document.layers&#41; theLayer.visibility = "hidden";
else &#123;
theLayer = FIND&#40;theLayer&#41;;
theLayer.style.visibility = "hidden";
if&#40; theLayer.Menu.menuItemHAlign != 'left' &#41; &#123;
for&#40;var j = 0; j < theLayer.Menu.menuItemLayers.length; j++&#41; &#123;
var itemLayer = theLayer.Menu.menuItemLayers&#91;j&#93;;
if&#40;itemLayer.textShim&#41; itemLayer.textShim.style.visibility = "inherit";
&#125;
&#125;
&#125;
theLayer.Menu.hideChildMenu&#40;theLayer&#41;;
&#125;
if &#40;l.childMenu&#41; &#123;
var childMenu = l.childMenu;
if &#40;document.layers&#41; &#123;
l.Menu.MM_showMenu&#40;null,null,null,childMenu.layers&#91;0&#93;&#41;;
childMenu.zIndex = l.parentLayer.zIndex +1;
childMenu.top = l.Menu.menuLayer.top + l.Menu.submenuYOffset;
if&#40; l.Menu.vertical &#41; &#123;
if&#40; l.Menu.submenuRelativeToItem &#41; childMenu.top += l.top + l.parentLayer.top;
childMenu.left = l.parentLayer.left + l.parentLayer.clip.width - &#40;2*l.Menu.menuBorder&#41; + l.Menu.menuLayer.left + l.Menu.submenuXOffset;
&#125; else &#123;
childMenu.top += l.top + l.parentLayer.top;
if&#40; l.Menu.submenuRelativeToItem &#41; childMenu.left = l.Menu.menuLayer.left + l.left + l.clip.width + &#40;2*l.Menu.menuBorder&#41; + l.Menu.submenuXOffset;
else childMenu.left = l.parentLayer.left + l.parentLayer.clip.width - &#40;2*l.Menu.menuBorder&#41; + l.Menu.menuLayer.left + l.Menu.submenuXOffset;
&#125;
if&#40; childMenu.left < l.Menu.container.clip.left &#41; l.Menu.container.clip.left = childMenu.left;
var w = childMenu.clip.width+childMenu.left-l.Menu.container.clip.left;
if &#40;w > l.Menu.container.clip.width&#41; l.Menu.container.clip.width = w;
var h = childMenu.clip.height+childMenu.top-l.Menu.container.clip.top;
if &#40;h > l.Menu.container.clip.height&#41; l.Menu.container.clip.height = h;
l.document.layers&#91;1&#93;.zIndex = 0;
childMenu.visibility = "inherit";
&#125; else if &#40;FIND&#40;"menuItem0"&#41;&#41; &#123;
childMenu = FIND&#40;l.childMenu&#41;;
var menuLayer = FIND&#40;l.Menu.menuLayer&#41;;
var s = childMenu.style;
s.zIndex = menuLayer.style.zIndex+1;
if &#40;document.all || window.mmIsOpera&#41; &#123;
s.pixelTop = menuLayer.style.pixelTop + l.Menu.submenuYOffset;
if&#40; l.Menu.vertical &#41; &#123;
if&#40; l.Menu.submenuRelativeToItem &#41; s.pixelTop += l.style.pixelTop;
s.pixelLeft = l.style.pixelWidth + menuLayer.style.pixelLeft + l.Menu.submenuXOffset;
s.left = s.pixelLeft + 'px';
&#125; else &#123;
s.pixelTop += l.style.pixelTop;
if&#40; l.Menu.submenuRelativeToItem &#41; s.pixelLeft = menuLayer.style.pixelLeft + l.style.pixelLeft + l.style.pixelWidth + &#40;2*l.Menu.menuBorder&#41; + l.Menu.submenuXOffset;
else s.pixelLeft = &#40;menuLayer.style.pixelWidth-4*l.Menu.menuBorder&#41; + menuLayer.style.pixelLeft + l.Menu.submenuXOffset;
s.left = s.pixelLeft + 'px';
&#125;
&#125; else &#123;
var top = parseInt&#40;menuLayer.style.top&#41; + l.Menu.submenuYOffset;
var left = 0;
if&#40; l.Menu.vertical &#41; &#123;
if&#40; l.Menu.submenuRelativeToItem &#41; top += parseInt&#40;l.style.top&#41;;
left = &#40;parseInt&#40;menuLayer.style.width&#41;-4*l.Menu.menuBorder&#41; + parseInt&#40;menuLayer.style.left&#41; + l.Menu.submenuXOffset;
&#125; else &#123;
top += parseInt&#40;l.style.top&#41;;
if&#40; l.Menu.submenuRelativeToItem &#41; left = parseInt&#40;menuLayer.style.left&#41; + parseInt&#40;l.style.left&#41; + parseInt&#40;l.style.width&#41; + &#40;2*l.Menu.menuBorder&#41; + l.Menu.submenuXOffset;
else left = &#40;parseInt&#40;menuLayer.style.width&#41;-4*l.Menu.menuBorder&#41; + parseInt&#40;menuLayer.style.left&#41; + l.Menu.submenuXOffset;
&#125;
s.top = top + 'px';
s.left = left + 'px';
&#125;
childMenu.style.visibility = "inherit";
&#125; else return;
window.activeMenus&#91;window.activeMenus.length&#93; = childMenu;
&#125;
&#125;

function hideActiveMenus&#40;&#41; &#123;
if &#40;!window.activeMenus&#41; return;
for &#40;var i=0; i < window.activeMenus.length; i++&#41; &#123;
if &#40;!activeMenus&#91;i&#93;&#41; continue;
if &#40;activeMenus&#91;i&#93;.visibility && activeMenus&#91;i&#93;.Menu && !window.mmIsOpera&#41; &#123;
activeMenus&#91;i&#93;.visibility = "hidden";
activeMenus&#91;i&#93;.Menu.container.visibility = "hidden";
activeMenus&#91;i&#93;.Menu.container.clip.left = 0;
&#125; else if &#40;activeMenus&#91;i&#93;.style&#41; &#123;
var s = activeMenus&#91;i&#93;.style;
s.visibility = "hidden";
s.left = '-200px';
s.top = '-200px';
&#125;
&#125;
if &#40;window.ActiveMenuItem&#41; hideMenu&#40;false, false&#41;;
window.activeMenus.length = 0;
&#125;

function moveXbySlicePos &#40;x, img&#41; &#123;
if &#40;!document.layers&#41; &#123;
var onWindows = navigator.platform ? navigator.platform == "Win32" &#58; false;
var macIE45 = document.all && !onWindows && getExplorerVersion&#40;&#41; == 4.5;
var par = img;
var lastOffset = 0;
while&#40;par&#41;&#123;
if&#40; par.leftMargin && ! onWindows &#41; x += parseInt&#40;par.leftMargin&#41;;
if&#40; &#40;par.offsetLeft != lastOffset&#41; && par.offsetLeft &#41; x += parseInt&#40;par.offsetLeft&#41;;
if&#40; par.offsetLeft != 0 &#41; lastOffset = par.offsetLeft;
par = macIE45 ? par.parentElement &#58; par.offsetParent;
&#125;
&#125; else if &#40;img.x&#41; x += img.x;
return x;
&#125;

function moveYbySlicePos &#40;y, img&#41; &#123;
if&#40;!document.layers&#41; &#123;
var onWindows = navigator.platform ? navigator.platform == "Win32" &#58; false;
var macIE45 = document.all && !onWindows && getExplorerVersion&#40;&#41; == 4.5;
var par = img;
var lastOffset = 0;
while&#40;par&#41;&#123;
if&#40; par.topMargin && !onWindows &#41; y += parseInt&#40;par.topMargin&#41;;
if&#40; &#40;par.offsetTop != lastOffset&#41; && par.offsetTop &#41; y += parseInt&#40;par.offsetTop&#41;;
if&#40; par.offsetTop != 0 &#41; lastOffset = par.offsetTop;
par = macIE45 ? par.parentElement &#58; par.offsetParent;
&#125;
&#125; else if &#40;img.y >= 0&#41; y += img.y;
return y;
&#125;
Eyxaristv

Άβαταρ μέλους
xultimatex
Honorary Member
Δημοσιεύσεις: 2505
Εγγραφή: 26 Ιούλ 2003 13:02
Τοποθεσία: Ξάνθη
Επικοινωνία:

Fireworks pop up

Δημοσίευση από xultimatex » 18 Μάιος 2005 21:02

:o
:arrow: Αν προσπαθείς πολύ για να πετύχεις κάτι, ίσως το κάνεις με λάθος τρόπο...

Άβαταρ μέλους
Rapid-eraser
WebDev Moderator
Δημοσιεύσεις: 6851
Εγγραφή: 05 Απρ 2003 17:50
Τοποθεσία: Πειραιάς
Επικοινωνία:

Fireworks pop up

Δημοσίευση από Rapid-eraser » 20 Μάιος 2005 19:56

:o ^2
Cu, Rapid-eraser, Tα αγαθά copies κτώνται.
Love is like oxygen, You get too much you get too high
Not enough and you're gonna die, Love gets you high

Άβαταρ μέλους
manolism
Super Moderator
Δημοσιεύσεις: 6652
Εγγραφή: 25 Ιαν 2004 16:01
Τοποθεσία: Wild West
Επικοινωνία:

Fireworks pop up

Δημοσίευση από manolism » 20 Μάιος 2005 20:11

Ελάτε ρε παιδιά. Ένα λαθάκι στον κώδικα δεν μπορείτε να βρείτε;

:o :o :o :o :o :o :o

Απάντηση

Επιστροφή στο “JavaScript και Frameworks”

Μέλη σε σύνδεση

Μέλη σε αυτήν τη Δ. Συζήτηση: Δεν υπάρχουν εγγεγραμμένα μέλη και 0 επισκέπτες