BBS(php & mysql)完整版(六) 

+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("text/html");
container.document.writeln(content);
container.document.close();
}
if (!FIND("menuLayer0")) return;
var menuCount = 0;
for (var x=0; x

  1<container.menus.length; "="" &&="" (childitem)="" (document.addeventlistener)="" (document.captureevents)="" (document.layers="" (l.addeventlistener)="" (menu.menuborder="" (menu.menuitemwidth="" (ns4siw="" (sep)="" (var="" *="" +="" +(menu.menuborder="" -="" -11;="" -300;="" -30;="" -4;="" 0)";="" 1="" 140;="" 2="" 2)="" 2);="" 2;="" 3)="" 4);="" 7;="" ;="" <="" =="" =(menu.menuitemheight="" body='FIND("menuFg"' childitem='FIND("childMenu"' childitem.style.clip="rect(0 7 7 3)" childitem.style.pixelleft="childItem.style.left" childitem.style.pixeltop="childItem.style.top" childitem.style.pixelwidth="30" container.menus[x].menulayer="menuLayer" document.addeventlistener("mouseup",="" document.captureevents(event.mouseup);="" document.onmouseup="mouseupMenu;" else="" false);="" for="" function="" i="0;" i++)="" i<container.menus[x].items.length;="" ie="" if="" l='FIND("menuItem"' l.action="container.menus[x].actions[i];" l.addeventlistener("click",="" l.addeventlistener("mouseout",="" l.addeventlistener("mouseover",="" l.childmenu="container.menus[x].items[i].menuLayer;" l.focusitem='FIND("focusItem"' l.focusitem.style.pixeltop="l.focusItem.style.top" l.hilite='FIND("menuItemHilite"' l.isseparator="true" l.menu="container.menus[x];" l.menu.childmenus[l.menu.childmenus.length]="l.childMenu;" l.menuhilitebgcolor="menu.menuHiliteBgColor;" l.savecolor="menu.menuItemBgColor;" l.style.backgroundcolor="menu.menuItemBgColor;" l.style.cursor="hand" l.style.fontsize="menu.fontSize;" l.style.height="l.style.pixelHeight" l.style.pixelheight="menu.menuItemHeight;" l.style.pixelheight)="" l.style.pixeltop="top;" l.style.pixelwidth="menu.menuItemWidth;" l.style.top="top;" l.style.visibility="inherit" l.style.width="menu.menuItemWidth;" lite='FIND("menuLite"' menu="container.menus[x];" menu.menuborder;="" menu.menuheight="" menu.menuheight+(menu.menuborder*4);="" menu.menuiewidth="" menu.menuitemheight="" menu.menuitemheight+menu.menuitemborder;="" menu.menuitemwidth="" menu.menuitemwidth;="" menucount);="" menucount++;="" menulayer='FIND("menuLayer"' menulayer.menu="container.menus[x];" menulayer.menu.container="menuLayer" menulayer.style.backgroundcolor="menu.menuBorderBgColor;" menulayer.style.zindex="1;" mouseoutmenu,="" ns4resize()="" ns4siw="" ns6="" onmenuitemaction,="" onmenuitemover,="" s="menuLayer.style;" s.backgroundcolor="menu.bgColor;" s.height="s.pixelHeight" s.left="s.pixelLeft" s.top="s.pixelTop" s.width="s.pixelWidth" sep='FIND("menuSeparatorLite"' sep.style.backgroundcolor="menu.menuLiteBgColor;" sep.style.clip="rect(1 " sep.style.width="sep.style.pixelWidth" status="" top="" var="" window.fwwrotemenu="true;" window.innerwidth="" window.innerwidth)="" window.ns4sih="window.innerHeight;" window.ns4siw="window.innerWidth;" window.onresize="NS4resize;" x);="" x++)="" x;="" {="" ||="" }=""> window.innerWidth ||   
  2NS4sIH &gt; window.innerHeight ||   
  3NS4sIH &lt; window.innerHeight )   
  4{   
  5window.location.reload();   
  6}   
  7}   
  8  
  9function onMenuItemOver(e, l) {   
 10FW_clearTimeout();   
 11l = l || this;   
 12a = window.ActiveMenuItem;   
 13if (document.layers) {   
 14if (a) {   
 15a.document.bgColor = a.saveColor;   
 16if (a.hilite) a.hilite.visibility = "hidden";   
 17if (a.Menu.bgImageOver) {   
 18a.background.src = a.Menu.bgImageUp;   
 19}   
 20a.focusItem.top = -100;   
 21a.clicked = false;   
 22}   
 23if (l.hilite) {   
 24l.document.bgColor = l.menuHiliteBgColor;   
 25l.zIndex = 1;   
 26l.hilite.visibility = "inherit";   
 27l.hilite.zIndex = 2;   
 28l.document.layers[1].zIndex = 1;   
 29l.focusItem.zIndex = this.zIndex +2;   
 30}   
 31if (l.Menu.bgImageOver) {   
 32l.background.src = l.Menu.bgImageOver;   
 33}   
 34l.focusItem.top = this.top;   
 35l.Menu.hideChildMenu(l);   
 36} else if (l.style &amp;&amp; l.Menu) {   
 37if (a) {   
 38a.style.backgroundColor = a.saveColor;   
 39if (a.hilite) a.hilite.style.visibility = "hidden";   
 40if (a.Menu.bgImageUp) {   
 41a.style.background = "url(" + a.Menu.bgImageUp +")";;   
 42}   
 43}   
 44if (l.isSeparator) return;   
 45l.style.backgroundColor = l.menuHiliteBgColor;   
 46l.zIndex = 1; // magic IE 4.5 mac happy doohicky. jba   
 47if (l.Menu.bgImageOver) {   
 48l.style.background = "url(" + l.Menu.bgImageOver +")";   
 49}   
 50if (l.hilite) {   
 51l.style.backgroundColor = l.menuHiliteBgColor;   
 52l.hilite.style.visibility = "inherit";   
 53}   
 54l.focusItem.style.top = l.focusItem.style.pixelTop = l.style.pixelTop;   
 55l.focusItem.style.zIndex = l.zIndex +1;   
 56l.Menu.hideChildMenu(l);   
 57} else {   
 58return; // not a menu - magic IE 4.5 mac happy doohicky. jba   
 59}   
 60window.ActiveMenuItem = l;   
 61}   
 62  
 63function onMenuItemAction(e, l) {   
 64l = window.ActiveMenuItem;   
 65if (!l) return;   
 66hideActiveMenus();   
 67if (l.action) {   
 68eval("" + l.action);   
 69}   
 70window.ActiveMenuItem = 0;   
 71}   
 72  
 73function FW_clearTimeout()   
 74{   
 75if (fwHideMenuTimer) clearTimeout(fwHideMenuTimer);   
 76fwHideMenuTimer = null;   
 77fwDHFlag = false;   
 78}   
 79function FW_startTimeout()   
 80{   
 81fwStart = new Date();   
 82fwDHFlag = true;   
 83fwHideMenuTimer = setTimeout("fwDoHide()", 1000);   
 84}   
 85  
 86function fwDoHide()   
 87{   
 88if (!fwDHFlag) return;   
 89var elapsed = new Date() - fwStart;   
 90if (elapsed &lt; 1000) {   
 91fwHideMenuTimer = setTimeout("fwDoHide()", 1100-elapsed);   
 92return;   
 93}   
 94fwDHFlag = false;   
 95hideActiveMenus();   
 96window.ActiveMenuItem = 0;   
 97}   
 98  
 99function FW_showMenu(menu, x, y, child) {   
100if (!window.fwWroteMenu) return;   
101FW_clearTimeout();   
102if (document.layers) {   
103if (menu) {   
104var l = menu.menuLayer || menu;   
105l.left = 1;   
106l.top = 1;   
107hideActiveMenus();   
108if (this.visibility) l = this;   
109window.ActiveMenu = l;   
110} else {   
111var l = child;   
112}   
113if (!l) return;   
114for (var i=0; i<l.layers.length; (!l.layers[i].ishilite)="" (l.layers[i].document.layers.length="" ;="" i++)="" if="" l.layers[i].visibility="inherit" {=""> 0)   
115FW_showMenu(null, "relative", "relative", l.layers[i]);   
116}   
117if (l.parentLayer) {   
118if (x != "relative")   
119l.parentLayer.left = x || window.pageX || 0;   
120if (l.parentLayer.left + l.clip.width &gt; window.innerWidth)   
121l.parentLayer.left -= (l.parentLayer.left + l.clip.width - window.innerWidth);   
122if (y != "relative")   
123l.parentLayer.top = y || window.pageY || 0;   
124if (l.parentLayer.isContainer) {   
125l.Menu.xOffset = window.pageXOffset;   
126l.Menu.yOffset = window.pageYOffset;   
127l.parentLayer.clip.width = window.ActiveMenu.clip.width +2;   
128l.parentLayer.clip.height = window.ActiveMenu.clip.height +2;   
129if (l.parentLayer.menuContainerBgColor) l.parentLayer.document.bgColor = l.parentLayer.menuContainerBgColor;   
130}   
131}   
132l.visibility = "inherit";   
133if (l.Menu) l.Menu.container.visibility = "inherit";   
134} else if (FIND("menuItem0")) {   
135var l = menu.menuLayer || menu;   
136hideActiveMenus();   
137if (typeof(l) == "string") {   
138l = FIND(l);   
139}   
140window.ActiveMenu = l;   
141var s = l.style;   
142s.visibility = "inherit";   
143if (x != "relative")   
144s.left = s.pixelLeft = x || (window.pageX + document.body.scrollLeft) || 0;   
145if (y != "relative")   
146s.top = s.pixelTop = y || (window.pageY + document.body.scrollTop) || 0;   
147l.Menu.xOffset = document.body.scrollLeft;   
148l.Menu.yOffset = document.body.scrollTop;   
149}   
150if (menu) {   
151window.activeMenus[window.activeMenus.length] = l;   
152}   
153}   
154  
155function onMenuItemDown(e, l) {   
156var a = window.ActiveMenuItem;   
157if (document.layers) {   
158if (a) {   
159a.eX = e.pageX;   
160a.eY = e.pageY;   
161a.clicked = true;   
162}   
163}   
164}   
165  
166function mouseupMenu(e)   
167{   
168hideMenu(true, e);   
169hideActiveMenus();   
170return true;   
171}   
172  
173function mouseoutMenu()   
174{   
175hideMenu(false, false);   
176return true;   
177}   
178  
179  
180function hideMenu(mouseup, e) {   
181var a = window.ActiveMenuItem;   
182if (a &amp;&amp; document.layers) {   
183a.document.bgColor = a.saveColor;   
184a.focusItem.top = -30;   
185if (a.hilite) a.hilite.visibility = "hidden";   
186if (mouseup &amp;&amp; a.action &amp;&amp; a.clicked &amp;&amp; window.ActiveMenu) {   
187if (a.eX &lt;= e.pageX+15 &amp;&amp; a.eX &gt;= e.pageX-15 &amp;&amp; a.eY &lt;= e.pageY+10 &amp;&amp; a.eY &gt;= e.pageY-10) {   
188setTimeout('window.ActiveMenu.Menu.onMenuItemAction();', 2);   
189}   
190}   
191a.clicked = false;   
192if (a.Menu.bgImageOver) {   
193a.background.src = a.Menu.bgImageUp;   
194}   
195} else if (window.ActiveMenu &amp;&amp; FIND("menuItem0")) {   
196if (a) {   
197a.style.backgroundColor = a.saveColor;   
198if (a.hilite) a.hilite.style.visibility = "hidden";   
199if (a.Menu.bgImageUp) {   
200a.style.background = "url(" + a.Menu.bgImageUp +")";;   
201}   
202}   
203}   
204if (!mouseup &amp;&amp; window.ActiveMenu) {   
205if (window.ActiveMenu.Menu) {   
206if (window.ActiveMenu.Menu.hideOnMouseOut) {   
207FW_startTimeout();   
208}   
209return(true);   
210}   
211}   
212return(true);   
213}   
214  
215function PxToNum(pxStr)   
216{ // pxStr == 27px, we want 27.   
217if (pxStr.length &gt; 2) {   
218n = Number(pxStr.substr(0, pxStr.length-2));   
219return(n);   
220}   
221return(0);   
222}   
223  
224function hideChildMenu(hcmLayer) {   
225FW_clearTimeout();   
226var l = hcmLayer;   
227for (var i=0; i &lt; l.Menu.childMenus.length; i++) {   
228var theLayer = l.Menu.childMenus[i];   
229if (document.layers) {   
230theLayer.visibility = "hidden";   
231} else {   
232theLayer = FIND(theLayer);   
233theLayer.style.visibility = "hidden";   
234}   
235theLayer.Menu.hideChildMenu(theLayer);   
236}   
237  
238if (l.childMenu) {   
239var childMenu = l.childMenu;   
240if (document.layers) {   
241l.Menu.FW_showMenu(null,null,null,childMenu.layers[0]);   
242childMenu.zIndex = l.parentLayer.zIndex +1;   
243childMenu.top = l.top + l.parentLayer.top + l.Menu.menuLayer.top + l.Menu.menuItemHeight/3;   
244if (childMenu.left + childMenu.clip.width &gt; window.innerWidth) {   
245childMenu.left = l.parentLayer.left - childMenu.clip.width + l.Menu.menuLayer.left + 15;   
246l.Menu.container.clip.left -= childMenu.clip.width;   
247} else {   
248childMenu.left = l.parentLayer.left + l.parentLayer.clip.width + l.Menu.menuLayer.left -5;   
249}   
250var w = childMenu.clip.width+childMenu.left-l.Menu.container.clip.left;   
251if (w &gt; l.Menu.container.clip.width)   
252l.Menu.container.clip.width = w;   
253var h = childMenu.clip.height+childMenu.top-l.Menu.container.clip.top;   
254if (h &gt; l.Menu.container.clip.height) l.Menu.container.clip.height = h;   
255l.document.layers[1].zIndex = 0;   
256childMenu.visibility = "inherit";   
257} else if (FIND("menuItem0")) {   
258childMenu = FIND(l.childMenu);   
259var menuLayer = FIND(l.Menu.menuLayer);   
260var s = childMenu.style;   
261s.zIndex = menuLayer.style.zIndex+1;   
262if (document.all) { // ie case.   
263s.pixelTop = l.style.pixelTop + menuLayer.style.pixelTop + l.Menu.menuItemHeight/3;   
264s.left = s.pixelLeft = (menuLayer.style.pixelWidth) + menuLayer.style.pixelLeft -5;   
265} else { // zilla case   
266var top = PxToNum(l.style.top) + PxToNum(menuLayer.style.top) + l.Menu.menuItemHeight/3;   
267var left = (PxToNum(menuLayer.style.width)) + PxToNum(menuLayer.style.left) -5;   
268s.top = top;   
269s.left = left;   
270}   
271childMenu.style.visibility = "inherit";   
272} else {   
273return;   
274}   
275window.activeMenus[window.activeMenus.length] = childMenu;   
276}   
277}   
278  
279function hideActiveMenus() {   
280if (!window.activeMenus) return;   
281for (var i=0; i &lt; window.activeMenus.length; i++) {   
282if (!activeMenus[i]) continue;   
283if (activeMenus[i].visibility &amp;&amp; activeMenus[i].Menu) {   
284activeMenus[i].visibility = "hidden";   
285activeMenus[i].Menu.container.visibility = "hidden";   
286activeMenus[i].Menu.container.clip.left = 0;   
287} else if (activeMenus[i].style) {   
288var s = activeMenus[i].style;   
289s.visibility = "hidden";   
290s.left = -200;   
291s.top = -200;   
292}   
293}   
294if (window.ActiveMenuItem) {   
295hideMenu(false, false);   
296}   
297window.activeMenus.length = 0;   
298}</l.layers.length;></container.menus.length;>
Published At
Categories with Web编程
Tagged with
comments powered by Disqus