中文(简体)
<style type="text/css"> .anylinkcss{ 位置:绝对;可见性:隐藏;边框:1px纯黑;边框底部宽度:0;字体:普通 12px Verdana;行高:18px; z 索引:100;背景颜色:#E9FECB;宽度:205px; } .anylinkcss a{ 宽度: 100%;显示:块;文本缩进:3px;底部边框:1px 纯黑色;内边距:1px 0;文本装饰:无;字体粗细:粗体;文本缩进:5px; } .anylinkcss a:hover{ /*悬停背景颜色*/ background-color: black;颜色: 白色; } </style> <script language="javascript"> //来自http://www.downcodes.com的更多javascript var gonedelay=250 //Mouseout时菜单消失速度(以毫秒为单位) var enableanchorlink=0 //启用或禁用单击时的锚链接? (1=e, 0=d) var hidemenu_onclick=1 //当用户在菜单中单击时隐藏菜单? (1=是, 0=否) /////无需进一步编辑 var ie5=document.all var ns6=document.getElementById&&!document.all function getposOffset(what, offsettype){ var Totaloffset=(offsettype=="左边”)?什么.offsetLeft : 什么.offsetTop; varparentEl=what.offsetParent; while (parentEl!=null){ Totaloffset=(offsettype=="left")?总偏移量+parentEl.offsetLeft : 总偏移量+parentEl.offsetTop; ParentEl=parentEl.offsetParent;返回总偏移量; } function showhide(obj, e,visible,hidden){ if (ie5||ns6) dropmenuobj.style.left=dropmenuobj.style.top=-500 if (e.type=="click" && obj.visibility==隐藏 || e.type=="mouseover") obj.visibility=visible else if (e.type=="click") obj.visibility=hidden } function iecompattest(){ return (document.compatMode && document.compatMode! =“后兼容”)? document.documentElement : document.body } functionclearbrowseredge(obj,whichedge){ var edgeoffset=0 if (whichedge=="rightedge"){ var windowedge=ie5 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15 dropmenuobj.contentmeasure=dropmenuobj.offsetWidth if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure) edgeoffset=dropmenuobj.contentmeasure-obj。 offsetWidth } else{ var windowedge=ie5 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18 dropmenuobj.contentmeasure=dropmenuobj.offsetHeight if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure) edgeoffset=dropmenuobj.contentmeasure+obj。 offsetHeight } return edgeoffset } function dropdownmenu(obj, e, dropmenuID){ if (window.event) event.cancelBubble=true else if (e.stopPropagation) e.stopPropagation() if (typeof dropmenuobj!="undefined") //隐藏上一个菜单 dropmenuobj.style.visibility="hidden"clearhidemenu() if (ie5||ns6){ obj.onmouseout=delayhidemenu dropmenuobj=document.getElementById(dropmenuID) if (hidemenu_onclick) dropmenuobj.onclick=function(){dropmenuobj. style.visibility='隐藏'} dropmenuobj.onmouseover=clearhidemenu dropmenuobj.onmouseout=ie5? function(){dynamichide(event)} : function(event){dynamichide(event)} showhide(dropmenuobj.style, e, "visible", "hidden") dropmenuobj.x=getposOffset(obj, "left") dropmenuobj. y=getposOffset(obj, "顶部") dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "右边缘")+"px" dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "底部边缘") +obj.offsetHeight+"px" } return clickreturnvalue() } function clickreturnvalue(){ if ((ie5||ns6) && !enableanchorlink) return false else return true } function contains_ns6(a, b) { while (b.parentNode) if ((b = b.parentNode) == a) 返回 true;返回假; } 函数dynamichide(e){ if (ie5&&!dropmenuobj.contains(e.toElement))delayhidemenu() else if (ns6&&e.currentTarget!= e.latedTarget&& !contains_ns6(e.currentTarget, e.latedTarget))delayhidemenu() }函数delayhidemenu(){delayhide = setTimeout(“dropmenuobj.style.visibility ='hidden'”,disappeardelay)}函数clearhidemenu(){if(typeofdelayhide!=“未定义”)clearTimeout(delayhide)}</script> <! --第一个链接和菜单 --> <a href="http://www.downcodes.com" onClick="return clickreturnvalue()" onMouseover="dropdownmenu(this, event, 'anylinkmenu1')">网页效果</a> <div id="anylinkmenu1" class="anylinkcss"> <a href="http://www.downcodes.com">图形图像</a> <a href="http://www .downcodes.com">鼠标事件</a> <a href="http://www.downcodes.com">时间日期</a> <a href="http://www.downcodes.com">导航菜单</a> <a href="http://www.downcodes.com">表单填写</a> <a href="http://www.downcodes.com">表单按钮</a> > <a href="http://www.downcodes.com">特殊脚本</a> <a href="http://www.downcodes.com">游戏娱乐</a> </div> < !-- 第二个链接和菜单 --> <a href="http://www.downcodes.com" onClick="return clickreturnvalue()" onMouseover="dropdownmenu(this, event, 'anylinkmenu2')">网络学院</a> <div id="anylinkmenu2" class="anylinkcss" style="width: 150px; background-color: lightyellow"> <a href="http://www.downcodes.com">网页制作</a> <a href="http://www.downcodes.com">网络编程</a > <a href="http://www.downcodes.com">图形图像</a> <a href="http://www.downcodes.com">多媒体制作</a> <a href=" http://www.downcodes.com">网站建设</a> <a href="http://www.downcodes.com">网络</a> </div>