首頁  >  文章  >  後端開發  >  BBS(php & mysql)完整版(六)_PHP教程

BBS(php & mysql)完整版(六)_PHP教程

WBOY
WBOY原創
2016-07-21 16:05:39797瀏覽

原型.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 = 身體.clip.width 1;
            lite.clip.height = 身體.clip.height 1;
            menu.clip.width = body.clip.width (proto.menuBorder * 3) ;
            menu.clip.height = body.clip.height (proto.menuBorder * 3);
        }
    } else {
        if ((!. 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            var menuLayer = FIND("menLa      var menuLayer = FIND("menLa  
            container.menus[x].menuLayer = "menuLayer" x;
            menuLayer.Menu = container.menus[x];
            menuLayer.Menu.container = "menuLayer" 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     
                l.Menu = container.menus[x];
                if (l.addEventListener) { // ns6
             
                     l.style.height = menu.menuItemHeight;
                     l.style.top = 上方;
      Over, false);
                     l.addEventListener("click", onMenuItemAction, false);
                     l.addEventListener("mouseout", mouseoutMenu, false);
                } else { //即
                
                     l.style.pixelHeight = menu.menuItemHeight;
                     l.style.pixelTop = 上方;
                }
                top = 上 menu.menuItemHeight menu.menuItemBorder;
                l.style.fontSize = menu.fontSize;
                l.style.backgroundColor = menu.menuItemBgColor;
                l.style.visibility = "繼承";
                l.saveColor = menu.menuItemBgColor;
                l.menuHiliteBgColor = menu.menuHiliteBgColor;
                l.action = container.menus[x].actions[i];
                l.hilite = FIND("menuItemHilite" menuCount);
                l.focusItem = FIND("focusItem" x);
                l.focusItem.style.pixelTop = l.focusItem.style.top = -30;
                var childItem = FIND("childMenu" menuCount);
                if (childItem) {
             
                    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 = "rect(0 7 7 3)";
                    l.Menu.childMenus[l.Menu.childMenus.length] = l.childMenu;
                }
                var sep = FIND("menuSeparator" menuCount);
                if (sep) {
             )";
                    sep.style.width = sep.style.pixelWidth = menu.menuItemWidth;     
                    sep.style.backgroundColor = menu.bgColor;
                    sep = FIND("menuSeparatorLite" menuCount);
                    sep.style.clip = "rect(1 " (menu.menuItemWidth - 3) " 2 0)";
                    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.pixel Height)
                } else {
                    l.style.cursor = "手"
                }
選單統計;
            }
            menu.menuHeight = top-1;
            var lite = FIND("menuLite" 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("menuFg" x);
            s = 身體.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) {         }
    if (document.addEventListener) {     
        document。
    }
    if (document.layers && window.innerWidth) {
        window.onresize = NS4resize;
        window.NS4sIW = window.innerWidth;
        window.NS4sIH = window.innerHeight;
    }
    document.onmouseup = mouseupMenu;
    window.fwWroteMenu = true;
    狀態 = "";
}

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

function onMenuItemOver(e, l) {
    FW_clearTimeout();
    l = l ||這;
    a = window.ActiveMenuItem;
    if (document.layers) {
        if (a) {
          
            if (a.hilite) a.hilite.visibility = "隱藏";
            if (a.Menu.bgImageOver) {
            
            }
            a.focusItem.top = -100;;
            a.clicked = false;
        }
        if (l.hilite) {
        
            l.zIndex = 1;
            l.hilite.visibility = "繼承";
            l.hilite.zIndex = 2;
            l.document.layers[1].zIndex = 1;
            l.focusItem.zIndex = this.zIndex 2;
        }
        if (l.Menu.bgImageOver) {
    
        }
        l.focusItem.top = this.top;
        l.Menu.hideChildMenu(l);
    } else if (l.style && l.Menu) {
        if (a) {
     
            if (a.hilite) a.hilite.style.visibility = "隱藏";
            if (a.Menu.bgImageUp) {
            
            }
        }  
     l.menuHiliteBgColor;
        l.zIndex = 1;  // 神奇的 IE 4.5 mac 快樂 doohicky。 ";
        }
        if (l.hilite) {
            l.style.background卷";
        }
        l.focusItem.style .top = l.focusItem.style.pixelTop = l.style.pixelTop;
        l.focusItem.style.zIndex = l.zIndex 1; Chi  } else {
        返回; // 不是選單- 神奇的IE 4.5 mac 快樂doohicky。 jba
    }
    window.ActiveMenuItem = l;
}

function onMenuItemAction(e, l) {
    l = window.ActiveMenuItem;
    如果(!l) 返回;
    hideActiveMenus();
    if (l.action) {
        eval(" ); 🎜>}

function FW_clearTimeout()
{
    if (fwHideMenuTimer)clearTimeout(fwHideMenuTimer);
  🎜>函數FW_startTimeout()
{
    fwStart = new Date();
    fwDHFlag = true;
    fwHideMenuTimer = setTimeout("fwDoHide()", 1000);
}

函數fwDoHide()
{
    if (!fwDHFlag) return;
    var elapsed = new Date() - fwStart;
   setTimeout("fwDoHide()", 1100 -elapsed);
        返回;
    }
    fwDHFlag = false;  Activ1.comom); 🎜>}

function FW_showMenu(menu , x, y, child) {
    if (!window.fwWroteMenu) return;
    FW_clearTimeout();
              var l = menu.menuLayer || enus();
            if (this.visibility) l = this;
          .ActiveMenu = l;
        } else {
            var l = child         for (var i=0; i             l.layers[i].visibility = "in繼承」;
            if (l.layers[i].document. layers.length > 0)  
                FW_showMenu(null, "relative", "relative", l.layers[i]) ;
        if (l.parentLayer) {
            if (x  ft = x ||視窗.pageX || 0;
            if (l.parentLayer.left l.clip.width > window.innerWidth)  
   l.clip.width - window.innerWidth);
            if (y != "relative")  
            0;
            if (l.parentLayer.isContainer) {
            ff
                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.ColgColor = l.parentLayer.uContainerBgmenor;
            }
        }
        l.visibility = "繼承";
        if (l.Menu) l.Menu.container.visibility = "繼承";
    } else if (FIND("menuItem0")) {
        var l = menu.menuLayer ||選單;     
        hideActiveMenus();
        if (typeof(l) == "string") {
            l = FIND(l);
        }
        window.ActiveMenu = l;
        var s = l.style;
        s.visibility = "繼承";
        if (x != "relative")  
            s.left = s.pixelLeft = x || (window.pageX document.body.scrollLeft) || 0;
        if (y != "relative")  
            s.top = s.pixelTop = y || (window.pageY document.body.scrollTop) || 0;
        l.Menu.xOffset = document.body.scrollLeft;
        l.Menu.yOffset = document.body.scrollTop;
    }
    if (選單) {
        window.activeMenus[window.activeMenus.length] = l;
    }
}

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

function mouseupMenu(e)
{  h );
    hideActiveMenus();
    回傳 true;
}

function mouseoutMenu()
{
    hideMenu(false, false);
    回傳 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 = "";
        if (mouseup && a.action && a.clicked && window.ActiveMenu) {
          = e.pageY 10 && a.eY >= e.pageY-10) {
               setTimeout('window.ActiveMenu.Menu.onMeItem
            }
        }
        
        if (a.Menu.bgImageOver) {
            a.background.src = a.Menu.bgImageUp
        }
    } else if (window.ActiveMenu && FIND("menuItem0")) {
  .style.backgroundColor = a.saveColor;
            if (a.hilite) a.hilite.style.visibility = "隱藏";
            if (a.Menu.bgImageUp) {
            
            }
        }
    } if (window.ActiveMenu.Menu) {
            if (window.ActiveMenu .Menu.hideOnMouseOut) {
                FW_startTimeout();
            }
            return(true);
        }
    }
    return(true);
}

function PxToNum(pxStr)
{ // pxStr == 27px,我們要 27。
    if (pxStr.length > 27。 pxStr.substr(0, pxStr.length-2));
        返回(n);
    }
    回(0);
}

function hideChildMenu(hcmLayer) {
    FW_clearTimeout();
    var l = hcmLayer;
    for (var i=0; i         var theLayer = l.Menu.childMenus[i];
        if (document.layers) {
            theLayer.visibility = "隱藏";
        } else {
            theLayer = FIND(theLayer);
            theLayer.style.visibility = "";
        }
        theLayer.Menu.hideChildMenu(theLayer);
    }

    if (l.childMenu) {
        var childMenu = l.childMenu;
        if (document.layers) {
            l.Menu.FW_showMenu(null,null,null,, 如果我們]Menu.
            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) {
    idth l.Menu.menuLayer.left 15;
                l.Menu.container.clip.left -= childMenu.clip.width;
            ,} else {
                
            ,
           var w = childMenu.clip.width childMenu.left-l.Melip.left-S.
            if (w > l.Menu.container.clip.width)   
       
            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 = "繼承";
        } else if (FIND("menuItem0")) {
            childMenu = FIND(l.childMenu);
            var menuLayer = FIND(l.Menu.menuLayer);
            var s = childMenu.style;
            s.zIndex = menuLayer.style.zIndex 1;
            if (document.all) { // 即情況下
            3;
                s.left = s.pixelLeft = (menuLayer.style.pixelWidth) menuLayer.style.pixelLeft -5;
            } else { // zilla case
               
                var left = (PxToNum(menuLayer.style.width)) PxToNum(menuLayer.style.left) -5;
                s.top = 上方;
            🎜>            childMenu.style.visibility = "繼承";
        } else {
            返回;
     ] = childMenu;
    }
}

function hideActiveMenus() {
    if (!window.activeMenus) return;
    for (var i=0; i         if (!activeMenus[i]) continue;
        if (activeMenus[i].visibility && activeMenus[i].Menu) {
          
            activeMenus[i].Menu.container.visibility = "隱藏";
            activeMenus[i].Menu.container.clip.left = 0;
        } else if (activeMenus[i].style) {
            var s = activeMenus[i].style;
            s.visibility = "隱藏上";
            s.left = -200;
            s.top = -200;
        }
    }
    if (window.ActiveMenuItem) {
   
    }
    window.activeMenus.length = 0;

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/315682.htmlTechArticle proto.menuBorder; var focusItem = body.document.layers[n]; focusItem.clip.width = body.clip.width; focusItem.Menu = l.Menu; focusItem.top = -30; focusItem.captureEvents(Event.MOUSE...
陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn