爱易网
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 浏览次数:20330 次
欢迎光临爱易网网页脚本特效中心,点击运行按钮演示特效:
以下是程序代码
要完成此效果需要三个步骤 第一步:把如下代码加入到<head>区域中 <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; } 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 propert
上一篇:狡猾的按钮特效
下一篇:点击单选框就直接激活链接
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
传三星为赢得新兴市场:推廉价版Note3
阿里收购UC 五年姻缘换来移动新格局
微软史上最大规模裁员,一半诺基亚员工
北京今日实现用支付宝钱包为公交卡充值
微软张亚勤趋势判断:未来三十年属于物理化互联网
苹果收购Beats交易或将延期尚需解决5大问题
解析2014年阿里百度等五大互联网巨头深度布局
工信部或本月17日向联通电信颁发FDD牌照
锐迪科将以9.25美元/ADS价钱出售835万份ADS
推荐阅读
更多>
工信部或本月17日向联通电信颁发FDD牌照
三星已经将Galaxy S5视为失败之作?
去看看外面的世界吧!别窝里斗了,中国在线旅游商们
马云:银行若放开存款利率 余额宝死了也光荣
搜狐与奇虎360或结盟对抗BAT
二维码支付大战的号角注定已经吹响,尚需标准发放
薛蛮子取保后首次发微博表示:辜负你们了
打车软件火了 恶性循环来了
支付宝被曝严重破绽 隐私平安再受质疑
新一代iPhone11月底国内上市 支持TD制式
HTC手机为何一败再败?效果出在供应链
京东终于想明白,这些年错过的财运,都藏在女人的时装下
清点:罗永浩推锤子ROM 小米打法遭模拟
墨迹也要做硬件,工具类应用如何“变异”的
小米年度发布会遭围剿!多款新品难阻品牌危机
微软不会被颠覆
用友软件股价逆势下跌 再融资方案现曙光
微软小冰复活再战移动端:改与米聊、易信和触宝合作
网络文学竞争白热化 百度多酷文学网上线
雅安地震 绝不宽恕应用人们爱心的骗子!