0

0

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

php中文网

php中文网

发布时间:2016-06-01 14:29:48

|

1024人浏览过

|

来源于php中文网

原创

+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       var menuLayer = FIND("menuLayer" + x);
      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         var l = FIND("menuItem" + 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("mouSEOver", onMenuItemOver, false);
          l.addEventListener("click", onMenuItemAction, false);
          l.addEventListener("mouseout", 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 = "inherit";
        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) {
          l.childMenu = container.menus[x].items[i].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 = "rect(0 7 7 3)";
          l.Menu.childMenus[l.Menu.childMenus.length] = l.childMenu;
        }
        var sep = FIND("menuSeparator" + menuCount);
        if (sep) {
          sep.style.clip = "rect(0 " + (menu.menuItemWidth - 3) + " 1 0)";
          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.pixelHeight)
        } else {
          l.style.cursor = "hand"
        }
        menuCount++;
      }
      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 = 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("mouseup", 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 = "";
}

function NS4resize() {
  if (NS4sIW     NS4sIW > window.innerWidth || 
    NS4sIH > window.innerHeight || 
    NS4sIH   {
    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 = "hidden";
      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 = "inherit";
      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 = "hidden";
      if (a.Menu.bgImageUp) {
        a.style.background = "url(" + a.Menu.bgImageUp +")";;
      }
    } 
    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 = "url(" + l.Menu.bgImageOver +")";
    }
    if (l.hilite) {
      l.style.backgroundColor = l.menuHiliteBgColor;
      l.hilite.style.visibility = "inherit";
    }
    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("" + 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("fwDoHide()", 1000);
}

function fwDoHide()
{
  if (!fwDHFlag) return;
  var elapsed = new Date() - fwStart;
  if (elapsed     fwHideMenuTimer = setTimeout("fwDoHide()", 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       if (!l.layers[i].isHilite) 
        l.layers[i].visibility = "inherit";
      if (l.layers[i].document.layers.length > 0) 
        FW_showMenu(null, "relative", "relative", l.layers[i]);
    }
    if (l.parentLayer) {
      if (x != "relative") 
        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 != "relative") 
        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 = "inherit";
    if (l.Menu) l.Menu.container.visibility = "inherit";
  } else if (FIND("menuItem0")) {
    var l = menu.menuLayer || menu;   
    hideActiveMenus();
    if (typeof(l) == "string") {
      l = FIND(l);
    }
    window.ActiveMenu = l;
    var s = l.style;
    s.visibility = "inherit";
    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 (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 = "hidden";
    if (mouseup && a.action && a.clicked && window.ActiveMenu) {
       if (a.eX = e.pageX-15 && 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("menuItem0")) {
    if (a) {
      a.style.backgroundColor = a.saveColor;
      if (a.hilite) a.hilite.style.visibility = "hidden";
      if (a.Menu.bgImageUp) {
        a.style.background = "url(" + a.Menu.bgImageUp +")";;
      }
    }
  }
  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     var theLayer = l.Menu.childMenus[i];
    if (document.layers) {
      theLayer.visibility = "hidden";
    } else {
      theLayer = FIND(theLayer);
      theLayer.style.visibility = "hidden";
    }
    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 = "inherit";
    } 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) { // 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 = "inherit";
    } else {
      return;
    }
    window.activeMenus[window.activeMenus.length] = 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].visibility = "hidden";
      activeMenus[i].Menu.container.visibility = "hidden";
      activeMenus[i].Menu.container.clip.left = 0;
    } else if (activeMenus[i].style) {
      var s = activeMenus[i].style;
      s.visibility = "hidden";
      s.left = -200;
      s.top = -200;
    }
  }
  if (window.ActiveMenuItem) {
    hideMenu(false, false);
  }
  window.activeMenus.length = 0;
PHP速学教程(入门到精通)
PHP速学教程(入门到精通)

PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!

下载

本站声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn

热门AI工具

更多
DeepSeek
DeepSeek

幻方量化公司旗下的开源大模型平台

豆包大模型
豆包大模型

字节跳动自主研发的一系列大型语言模型

通义千问
通义千问

阿里巴巴推出的全能AI助手

腾讯元宝
腾讯元宝

腾讯混元平台推出的AI助手

文心一言
文心一言

文心一言是百度开发的AI聊天机器人,通过对话可以生成各种形式的内容。

讯飞写作
讯飞写作

基于讯飞星火大模型的AI写作工具,可以快速生成新闻稿件、品宣文案、工作总结、心得体会等各种文文稿

即梦AI
即梦AI

一站式AI创作平台,免费AI图片和视频生成。

ChatGPT
ChatGPT

最最强大的AI聊天机器人程序,ChatGPT不单是聊天机器人,还能进行撰写邮件、视频脚本、文案、翻译、代码等任务。

相关专题

更多
pixiv网页版官网登录与阅读指南_pixiv官网直达入口与在线访问方法
pixiv网页版官网登录与阅读指南_pixiv官网直达入口与在线访问方法

本专题系统整理pixiv网页版官网入口及登录访问方式,涵盖官网登录页面直达路径、在线阅读入口及快速进入方法说明,帮助用户高效找到pixiv官方网站,实现便捷、安全的网页端浏览与账号登录体验。

1142

2026.02.13

微博网页版主页入口与登录指南_官方网页端快速访问方法
微博网页版主页入口与登录指南_官方网页端快速访问方法

本专题系统整理微博网页版官方入口及网页端登录方式,涵盖首页直达地址、账号登录流程与常见访问问题说明,帮助用户快速找到微博官网主页,实现便捷、安全的网页端登录与内容浏览体验。

371

2026.02.13

Flutter跨平台开发与状态管理实战
Flutter跨平台开发与状态管理实战

本专题围绕Flutter框架展开,系统讲解跨平台UI构建原理与状态管理方案。内容涵盖Widget生命周期、路由管理、Provider与Bloc状态管理模式、网络请求封装及性能优化技巧。通过实战项目演示,帮助开发者构建流畅、可维护的跨平台移动应用。

245

2026.02.13

TypeScript工程化开发与Vite构建优化实践
TypeScript工程化开发与Vite构建优化实践

本专题面向前端开发者,深入讲解 TypeScript 类型系统与大型项目结构设计方法,并结合 Vite 构建工具优化前端工程化流程。内容包括模块化设计、类型声明管理、代码分割、热更新原理以及构建性能调优。通过完整项目示例,帮助开发者提升代码可维护性与开发效率。

37

2026.02.13

Redis高可用架构与分布式缓存实战
Redis高可用架构与分布式缓存实战

本专题围绕 Redis 在高并发系统中的应用展开,系统讲解主从复制、哨兵机制、Cluster 集群模式及数据分片原理。内容涵盖缓存穿透与雪崩解决方案、分布式锁实现、热点数据优化及持久化策略。通过真实业务场景演示,帮助开发者构建高可用、可扩展的分布式缓存系统。

114

2026.02.13

c语言 数据类型
c语言 数据类型

本专题整合了c语言数据类型相关内容,阅读专题下面的文章了解更多详细内容。

77

2026.02.12

雨课堂网页版登录入口与使用指南_官方在线教学平台访问方法
雨课堂网页版登录入口与使用指南_官方在线教学平台访问方法

本专题系统整理雨课堂网页版官方入口及在线登录方式,涵盖账号登录流程、官方直连入口及平台访问方法说明,帮助师生用户快速进入雨课堂在线教学平台,实现便捷、高效的课程学习与教学管理体验。

17

2026.02.12

豆包AI网页版入口与智能创作指南_官方在线写作与图片生成使用方法
豆包AI网页版入口与智能创作指南_官方在线写作与图片生成使用方法

本专题汇总豆包AI官方网页版入口及在线使用方式,涵盖智能写作工具、图片生成体验入口和官网登录方法,帮助用户快速直达豆包AI平台,高效完成文本创作与AI生图任务,实现便捷智能创作体验。

863

2026.02.12

PostgreSQL性能优化与索引调优实战
PostgreSQL性能优化与索引调优实战

本专题面向后端开发与数据库工程师,深入讲解 PostgreSQL 查询优化原理与索引机制。内容包括执行计划分析、常见索引类型对比、慢查询优化策略、事务隔离级别以及高并发场景下的性能调优技巧。通过实战案例解析,帮助开发者提升数据库响应速度与系统稳定性。

123

2026.02.12

热门下载

更多
网站特效
/
网站源码
/
网站素材
/
前端模板

精品课程

更多
相关推荐
/
热门推荐
/
最新课程
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送

Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号