爱易网
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 浏览次数:20240 次
以下是程序代码
<html> <head> <meta name="keywords" content="站长,网页特效,js特效,广告代码,zzjs,zzjs.net,sky,www.zzjs.net,站长特效 网" /> <meta name="description" content="www.zzjs.net,站长特效网,站长必备js特效及广告代码。大量高质量js特效,提供高质量广告代码下载,尽在站长特效网" /> <title>可刷新Js树型菜单,zzjs.net收集,站长特效网欢迎您。</title> <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: '/img/base.gif', folder: '/img/folder.gif', folderOpen: '/img/folderopen.gif', node: '/img/page.gif', empty: '/img/empty.gif', line: '/img/line.gif', join: '/img/join.gif', joinBottom: '/img/joinbottom.gif', plus: '/img/plus.gif', plusBottom: '/img/plusbottom.gif', minus: '/img/minus.gif', minusBottom: '/img/minusbottom.gif', nlPlus: '', nlMinus: '' }; 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) ? this.icon.folder : this.icon.node); if (!node.iconOpen) node.iconOpen = (node._hc) ? this.icon.folderOpen : this.icon.node; if (this.root.id == node.pid) { node.icon = this.icon.root; node.iconOpen = this.icon.root; } str += '<img id="i' + this.obj + nodeId + '" src="' + ((node._io) ? node.iconOpen : node.icon) + '" alt="" onload="return imgzoom(this,600);" onclick="javascript:window.open(this.src);" style="cursor:pointer;"/>'; } if (node.url) { str += '<a id="s' + this.obj + nodeId + '" class="' + ((this.config.useSelection) ? ((node._is ? 'nodeSel' : 'node')) : 'node') + '" href
上一篇:狡猾的按钮特效
下一篇:后台常用js菜单
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
八位知名设计师评iOS7:新鲜但复杂
FB上广告费用昂贵而且效果不及Twitter
360涉足搜索范围 百度市场份额面临应战
蓝宝石PK大猩猩玻璃:作为屏幕谁更有优势?
支付宝钱包支持医保移动缴费 广州成首个试点
马云:银行若放开存款利率 余额宝死了也光荣
二代 iPad Air将配备2GB内存?为同屏多任务做准备
微信收费形式三选一 腾讯或变身运营商
中国邮政与阿里合作:邮政网点可做网购自提点
推荐阅读
更多>
小微型IDC云化趋势加剧 云计算未来或现终极模式
华为美国推出电商网站 发售Mate 2LTE版
虚拟运营市场躁动:山西煤老板兴味浓重
支付宝曝平安破绽:转账信息被谷歌抓取
中移动推动感地带3G网聊卡 火拼微信沃卡
网曝富士康“二连跳” 疑因推静音模式
盛大游戏走向衰落的根源:免费游戏模式惹的祸
中电信国际漫游费下调85% 世界杯上网28元/天
一个非脑残米粉的思考:小米“成功之道”如何炼成
中国电信内外受困 去电信化思绪待改
传三星为赢得新兴市场:推廉价版Note3
从旗下三大业务BG发展看华为的过去现在和未来
清点:罗永浩推锤子ROM 小米打法遭模拟
北京今日实现用支付宝钱包为公交卡充值
联想国庆完成收购IBM x86服务器
全球最具“颠覆性”特质的公司排行榜TOP25
“宽带中国”计划已正式上升为国家战略
SAP高层调整:联席CEO孟鼎铭成唯一掌舵人
中方抗议美方限购IT设备 紧张关系加剧
中移动将推出多项4G资费新政