爱易网
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特效
左上角精美导航
左上角精美导航
日期:2014-05-18 浏览次数:20351 次
以下是程序代码
<script> var isDOM = (document.getElementById ? true : false); var isIE4 = ((document.all && !isDOM) ? true : false); var isNS4 = (document.layers ? true : false); function getRef(id) { if (isDOM) return document.getElementById(id); if (isIE4) return document.all[id]; if (isNS4) return document.layers[id]; } function getSty(id) { return (isNS4 ? getRef(id) : getRef(id).style); } // Hide timeout. var popTimer = 0; // Array showing highlighted menu items. var litNow = new Array(); function popOver(menuNum, itemNum) { clearTimeout(popTimer); hideAllBut(menuNum); litNow = getTree(menuNum, itemNum); changeCol(litNow, true); targetNum = menu[menuNum][itemNum].target; if (targetNum > 0) { thisX = parseInt(menu[menuNum][0].ref.left) + parseInt(menu[menuNum][itemNum].ref.left); thisY = parseInt(menu[menuNum][0].ref.top) + parseInt(menu[menuNum][itemNum].ref.top); with (menu[targetNum][0].ref) { left = parseInt(thisX + menu[targetNum][0].x); top = parseInt(thisY + menu[targetNum][0].y); visibility = 'visible'; } } } function popOut(menuNum, itemNum) { if ((menuNum == 0) && !menu[menuNum][itemNum].target) hideAllBut(0) else popTimer = setTimeout('hideAllBut(0)', 500); } function getTree(menuNum, itemNum) { // Array index is the menu number. The contents are null (if that menu is not a parent) // or the item number in that menu that is an ancestor (to light it up). itemArray = new Array(menu.length); while(1) { itemArray[menuNum] = itemNum; // If we've reached the top of the hierarchy, return. if (menuNum == 0) return itemArray; itemNum = menu[menuNum][0].parentItem; menuNum = menu[menuNum][0].parentMenu; } } // Pass an array and a boolean to specify colour change, true = over colour. function changeCol(changeArray, isOver) { for (menuCount = 0; menuCount < changeArray.length; menuCount++) { if (changeArray[menuCount]) { newCol = isOver ? menu[menuCount][0].overCol : menu[menuCount][0].backCol; // Change the colours of the div/layer background. with (menu[menuCount][changeArray[menuCount]].ref) { if (isNS4) bgColor = newCol; else backgroundColor = newCol; } } } } function hideAllBut(menuNum) { var keepMenus = getTree(menuNum, 1); for (count = 0; count < menu.length; count++) if (!keepMenus[count]) menu[count][0].ref.visibility = 'hidden'; changeCol(litNow, false); } // *** MENU CONSTRUCTION FUNCTIONS *** function Menu(isVert, popInd, x, y, width, overCol, backCol, borderClass, textClass) { // True or false - a vertical menu? this.isVert = isVert; // The popout indicator used (if any) for this menu. this.popInd = popInd // Position and size settings. this.x = x; this.y = y; this.width = width; // Colours of menu and items. this.overCol = overCol; this.backCol = backCol; // The stylesheet class used for item borders and the text within items. this.borderClass = borderClass; this.textClass = textClass; // Parent menu and item numbers, indexed later. this.parentMenu = null; this.parentItem = null; // Reference to the object's style properties (set later). this.ref = null; } function Item(text, href, frame, length, spacing, target) { this.text = text; this.href = href; this.frame = frame; this.length = length; this.spacing = spacing; this.target = target; // Reference to the object's style properties (set later). this.ref = null; }//欢迎来到站长特效网,我们的网址是www.zzjs.net,很好记,zz站长,js就是js特效,本站收集大量高质量js代码,还有许多广告代码下载。 function writeMenus() { if (!isDOM && !isIE4 && !isNS4) return; for (currMenu = 0; currMenu < menu.length; currMenu++) with (menu[currMenu][0]) { // Variable for holding HTML for items and positions of next item. var str = '', itemX = 0, itemY = 0; // Remember, items start from 1 in the array (0 is menu object itself, above). // Also use properties of each ite
上一篇:狡猾的按钮特效
下一篇:CSS制作透明效果下拉菜单
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
墨迹也要做硬件,工具类应用如何“变异”的
巨人网络回应央视 否认应用黑客停止诈骗
魅族黄章惹怒芙蓉姐姐 将跨界推女神手机
火一把就死: 百度魔图验证社交游戏衰亡宿命
App Store严禁推送广告 运用面临大清洗
微软谷歌高层访韩面前:忌惮三星的崛起
中移动将推出多项4G资费新政
虚拟运营商温度有多高?降温OR升温内外有别
传运营商高层将变化 专家称需体制革新
推荐阅读
更多>
中国移动承诺再降4G资费 网络漫游至50个国家
喜大普奔:2016年国内乘客有望在飞机上使用手机
同样的背景,罗永浩和雷军到底有什么不同?
人们为什么总愿尝试新社交网络?
百度对糯米来说到底意味着什么?
史玉柱卸任巨人网络CEO 继位人选引猜想
微软不会被颠覆
HDS发布《2013中国CIO洞察白皮书》
华为任正非:家族成员不会成为接班人
盘点改变社会的15种科技:谷歌眼镜将使我们成为半机械人
HTC与苹果三星距离扩展 C2B形式成新武器
屌丝程序猿发家机会来了 用大数据来做生意!
传陌陌或12月赴美IPO 估值约30亿美元
《归来》遭视频网盗播 乐视网状告小米盒子侵权
中国手游总裁及8名高管集体下岗,被指涉不当交易
马云寄厚望于物流 “菜鸟”行情暂难持续
互联网金融一周年:余额宝最接地气,比特币最作死
称产品遭诋毁 奇虎再诉百度
安全服务机构:公布2014年度最糟糕的25个密码
手游市场乱象丛生 受资本热捧野蛮成长