中文(简体)
<style type="text/css"> .mainDiv { width:160px; } .topItem { 宽度:160px;高度:22px;光标:指针;背景:#467BF2;文本装饰:无;颜色: 白色;字体粗细:粗体;字体系列:“哥特式”; } .dropMenu { 背景:#D9D9D9;顶部边框:1px实心#467BF2;左边框:1px实心#92B1F8;右边框:1px实心#92B1F8;边框底部:1px实心#92B1F8; } .subMenu { 显示:无; } .subItem { padding-left:5px;光标:指针;字体粗细:粗体;文本装饰:无;颜色:黑色; } .subItem a { 文本装饰:无;颜色:黑色; } .subItemOver { 光标:指针;颜色:蓝色;文本装饰:下划线;字体粗细:粗体;左内边距:5px; } .subItemOver a { 颜色:蓝色; } .drop { 左边框:1px 纯黑;右边框:1px 纯黑; } </style> <script language="javascript"> //来自 http://www.downcodes.com 的更多 javascript var TIMER_SLIDE = null; var OBJ_SLIDE; var OBJ_VIEW; var PIX_SLIDE = 10; //这是幻灯片的数量/DELAY_SLIDE var NEW_PIX_VAL;变量 DELAY_SLIDE = 30; //这是每次调用幻灯片之间的时间 var DIV_HEIGHT = 22; //值无关 var SUB_MENU_NUM =0; var RE_INIT_OBJ = null; var bMenu = document.getElementById("curMenu"); var MainDiv,SubDiv //DD 添加代码 document.write('<div id="tempcontainer" class="mainDiv" style="visibility: hide;position:absolute"></div>') function Init(objDiv) { if (TIMER_SLIDE == null) { SUB_MENU_NUM = 0; MainDiv = objDiv.parentNode; SubDiv = MainDiv.getElementsByTagName("DIV").item(0); SubDiv.onclick = SetSlide; OBJ_SLIDE = MainDiv.getElementsByTagName("DIV").item(1) OBJ_VIEW = OBJ_SLIDE.getElementsByTagName("DIV").item(0); document.getElementById("tempcontainer").innerHTML=MainDiv.getElementsByTagName("DIV").item(2).innerHTML //DD 添加代码 DIV_HEIGHT=document.getElementById("tempcontainer").offsetHeight //DD 添加代码 for ( i=0;i<OBJ_VIEW.childNodes.length;i++) { if (OBJ_VIEW.childNodes.item(i).tagName == "SPAN") { SUB_MENU_NUM ++; OBJ_VIEW.childNodes.item(i).onmouseover= ChangeStyle; OBJ_VIEW.childNodes.item(i).onmouseout=ChangeStyle; NEW_PIX_VAL = parseInt(MainDiv.getAttribute("state")); } } function SetSlide() { if (window.TIMER_SLIDE) clearInterval(TIMER_SLIDE) //DD 添加代码 if (TIMER_SLIDE == null && this.parentNode == MainDiv) TIMER_SLIDE = setInterval('RunSlide()', DELAY_SLIDE);否则 { RE_INIT_OBJ = this; setTimeout('ReInit()', 200); } } 函数 ReInit(obj) { 初始化(RE_INIT_OBJ); TIMER_SLIDE = setInterval('RunSlide()', DELAY_SLIDE); RE_INIT_OBJ = 空; } 函数 RunSlide() { if (OBJ_VIEW.getAttribute("state") == 0) { NEW_PIX_VAL += PIX_SLIDE; OBJ_SLIDE.style.height = NEW_PIX_VAL; if (NEW_PIX_VAL >= DIV_HEIGHT) //DD 修改代码 {clearInterval(TIMER_SLIDE); TIMER_SLIDE = 空; OBJ_VIEW.style.display = '内联'; OBJ_VIEW.setAttribute("状态","1") MainDiv.setAttribute("状态",NEW_PIX_VAL); } } else { OBJ_VIEW.style.display = '无'; NEW_PIX_VAL -= PIX_SLIDE; if(NEW_PIX_VAL > 0)OBJ_SLIDE.style.height = NEW_PIX_VAL;如果(NEW_PIX_VAL <= 0){ NEW_PIX_VAL = 0; OBJ_SLIDE.style.height = NEW_PIX_VAL 清除间隔(TIMER_SLIDE); TIMER_SLIDE = 空; OBJ_VIEW.setAttribute("状态","0") MainDiv.setAttribute("状态",NEW_PIX_VAL); } } } function ChangeStyle() { if (this.className == this.getAttribute("classOut")) this.className = this.getAttribute("classOver");否则 this.className = this.getAttribute("classOut"); } </script> <!--------开始菜单----------> <div class="mainDiv" state="0"> <div class="topItem" classOut= “topItem”classOver=“topItemOver”onMouseOver=“Init(这个);” >网页特效</div> <div class="dropMenu" > <div class="subMenu" state="0"> <span class="subItem" classOut="subItem" classOver="subItemOver"><a href= "http://www.downcodes.com">图形图像</a></span><BR /> <span class="subItem" classOut="subItem" classOver="subItemOver"><a href="http ://www.downcodes.com">鼠标事件</a></span><BR /> <span class="subItem" classOut="subItem" classOver="subItemOver"><a href="http:// /www.downcodes.com">时间日期</a></span><BR /> <span class="subItem" classOut="subItem" classOver="subItemOver"><a href="http://www .downcodes.com">导航菜单</a></span><BR /> <span class="subItem" classOut="subItem" classOver="subItemOver"><a href="http://www.downcodes .com">文字效果</a></span> </div> </div> </div> <!--------结束菜单----------> < BR /> <!--------开始菜单----------> <div class="mainDiv" state="0"> <div class="topItem" classOut="topItem " classOver="topItemOver" onMouseOver="Init(this)" >网页教学</div> <div class="dropMenu" > <div class="subMenu" state="0"> <span class="subItem" classOut ="subItem" classOver="subItemOver"><a href="http://www.downcodes.com">网页制作</a></span><BR /> <span class="subItem" classOut=" subItem" classOver="subItemOver"><a href="http://www.downcodes.com">网络编程</a></span><BR /> <span class="subItem" classOut="subItem" classOver="subItemOver"><a href="http://www.downcodes.com">图形图像</a></span> </div> </div> </div> <!---- ----结束菜单----------> <BR /> <!--------开始菜单----------> <div class="mainDiv " state="0"> <div class="topItem" classOut="topItem" classOver="topItemOver" onMouseOver="Init(this)" > 网络开发</div> <div class="dropMenu"> <div class ="subMenu" state="0"> <span class="subItem" classOut="subItem" classOver="subItemOver"><a href="http://www.downcodes.com">网页设计</a> </span><BR /> <span class="subItem" classOut="subItem" classOver="subItemOver"><a href="http://www.downcodes.com">艺术创作</a></ span><BR /> <span class="subItem" classOut="subItem" classOver="subItemOver"><a href="http://www.downcodes.com">电脑网络</a></span> </div> </div> </div> <!--------结束菜单--------->