爱易网
IT新闻
IT新闻
爱易资讯
网站搭建
云虚拟主机教程
云服务器教程
Apache教程
IIS教程
Nginx教程
网站策划
站长文章
推广教程
淘宝客教程
网页设计
HTML教程
XHTML教程
CSS教程
HTML5教程
CSS3教程
JavaSript基础
JQuery教程
Node.js教程
前端技术
Ajax教程
Js特效
Xml教程
平面设计
页面UI设计
photoshop教程
程序开发
AI人工智能
Asp教程
Php教程
Asp.Net教程
Net Core教程
C#教程
Java教程
Jsp教程
开发技术
微信小程序教程
Uniapp开发教程
微信公众号开发
Andriod教程
IOS教程
DOS教程
Python教程
Docker教程
Windows Container教程
数据库
MSSQL教程
MySQL教程
Redis教程
Access教程
Oracle教程
数据库教程
操作系统
Linux教程
Windows教程
MAC教程
Cisco教程
交换机教程
防火墙教程
搜索
爱易网页
JS特效
无限级可刷新Js树型导航菜单
无限级可刷新Js树型导航菜单
日期:2014-05-18 浏览次数:20125 次
以下是程序代码
<html> <head> <title>无限级可刷新Js树型菜单</title> <meta name="robots" content="无限级可刷新Js树型菜单" /> <meta name="description" content="无限级可刷新Js树型菜单" /> <script type="text/javascript"> function Node(id, pid, name, url, title, target, icon, iconOpen, open) { this.id = id; this.pid = pid; this.name = name; this.url = url; this.title = title; this.target = target; this.icon = icon; this.iconOpen = iconOpen; this._io = open || false; this._is = false; this._ls = false; this._hc = false; this._ai = 0; this._p; }; // Tree object function dTree(objName) { this.config = { target: null, folderLinks: true, useSelection: true, useCookies: true, useLines: true, useIcons: true, useStatusText: false, closeSameLevel: false, inOrder: false } this.icon = { root: 'http://www.qpsh.com/icon/wx/base.gif', folder: 'http://www.qpsh.com/icon/wx/folder.gif', folderOpen: 'http://www.qpsh.com/icon/wx/folderopen.gif', node: 'http://www.qpsh.com/icon/wx/page.gif', empty: 'http://www.qpsh.com/icon/wx/empty.gif', line: 'http://www.qpsh.com/icon/wx/line.gif', join: 'http://www.qpsh.com/icon/wx/join.gif', joinBottom: 'http://www.qpsh.com/icon/wx/joinbottom.gif', plus: 'http://www.qpsh.com/icon/wx/plus.gif', plusBottom: 'http://www.qpsh.com/icon/wx/plusbottom.gif', minus: 'http://www.qpsh.com/icon/wx/minus.gif', minusBottom: 'http://www.qpsh.com/icon/wx/minusbottom.gif', nlPlus: 'http://www.qpsh.com/icon/wx/nolines_plus.gif', nlMinus: 'http://www.qpsh.com/icon/wx/nolines_minus.gif' }; this.obj = objName; this.aNodes = []; this.aIndent = []; this.root = new Node(-1); this.selectedNode = null; this.selectedFound = false; this.completed = false; }; // Adds a new node to the node array dTree.prototype.add = function(id, pid, name, url, title, target, icon, iconOpen, open) { this.aNodes[this.aNodes.length] = new Node(id, pid, name, url, title, target, icon, iconOpen, open); }; // Open/close all nodes dTree.prototype.openAll = function() { this.oAll(true); }; dTree.prototype.closeAll = function() { this.oAll(false); }; // Outputs the tree to the page dTree.prototype.toString = function() { var str = '<div class="dtree">\n'; if (document.getElementById) { if (this.config.useCookies) this.selectedNode = this.getSelected(); str += this.addNode(this.root); } else str += 'Browser not supported.'; str += '</div>'; if (!this.selectedFound) this.selectedNode = null; this.completed = true; return str; }; // Creates the tree structure dTree.prototype.addNode = function(pNode) { var str = ''; var n=0; if (this.config.inOrder) n = pNode._ai; for (n; n<this.aNodes.length; n++) { if (this.aNodes[n].pid == pNode.id) { var cn = this.aNodes[n]; cn._p = pNode; cn._ai = n; this.setCS(cn); if (!cn.target && this.config.target) cn.target = this.config.target; if (cn._hc && !cn._io && this.config.useCookies) cn._io = this.isOpen(cn.id); if (!this.config.folderLinks && cn._hc) cn.url = null; if (this.config.useSelection && cn.id == this.selectedNode && !this.selectedFound) { cn._is = true; this.selectedNode = n; this.selectedFound = true; } str += this.node(cn, n); if (cn._ls) break; } } return str; }; // Creates the node icon, url and text dTree.prototype.node = function(node, nodeId) { var str = '<div class="dTreeNode">' + this.indent(node, nodeId); if (this.config.useIcons) { if (!node.icon) node.icon = (this.root.id == node.pid) ? this.icon.root : ((node._hc) ? th
上一篇:狡猾的按钮特效
下一篇:阿里巴巴滑动导航广告代码
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
“世界杯+618”集体磨刀的本质是绑架全民
小微型IDC云化趋势加剧 云计算未来或现终极模式
诺基亚再缩阵线 封锁上海旗舰店全力蜕变
特斯拉将获上海免费牌照 充电桩面临双重标准
华为任正非:家族成员不会成为接班人
国美痛批网购七宗罪 用短暂盈利输了未来
杨元庆去年总薪酬1.33亿元
Docker Desktop 4.11 发布:支持虚拟桌面、Mac 权限更改和新扩展
互联网金融一周年:余额宝最接地气,比特币最作死
推荐阅读
更多>
据消息传百度将要控股携程 整合去哪儿
说说这一个月的赌球输了多少
华为坚持不上市究竟为何?不差钱也不想冒风险
国美电商开打价钱战 牟贵先言行矛盾受质疑
途牛旅游网今晚挂牌纳斯达克 融资1亿美元
百度透露无人驾驶战略 研发三维交通地图
携程收买酷讯成定局:转型互联网+投资
小米盗版有理激怒乐视:提500部盗播证据猛追打
AMD Q1净亏1.46亿美元 转战SOC拥抱ARM求变
HTC手机为何一败再败?效果出在供应链
电信设备商淘金中国4G:华为中兴领衔
富士康人事故骚动方寸 不惜血本下注电商
联发科享用价钱战 专利难以摆脱高通
诺基亚培育低端机市场 迂回战术要挟中华酷联
迅雷高管解读财报:收购快盘可快速融入小米
Docker Desktop 4.11 发布:支持虚拟桌面、Mac 权限更改和新扩展
从WPS到office365,中国企业能否赶超美国?
电信业营改增今起实施 运营商短期利润骤降
看病也能用支付宝了 马云的又一盘大棋
蘑菇街CEO陈琪:2015将回归社会化电商