鼠标经过显示二级菜单js特效

2019-12-24,,,,

复制代码 代码如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=gb2312" />
<title>鼠标经过显示二级菜单js特效</title>
</head>
<body>
<a href="//www.jb51.net" onMouseover="showit(0)">北冥有鱼</a> | <a href="http://play.jb51.net" onMouseover="showit(1)">播放器之家</a><br>
<div id="describe" style="width:600px;height:40px; margin-top:10px;" onMouseover="clear_delayhide()" onMouseout="resetit(event)"></div>
<script language="JavaScript1.2">
var submenu=new Array()
submenu[0]='<b><a href="//www.jb51.net/">北冥有鱼</a> | <a href="http://play.jb51.net">播放器之家</a> | <a href="http://sc.jb51.net/">素材之家</a> | <a href="http://mingzi.jb51.net/">个性名字网</a> | <a href="http://office.jb51.net/">Office之家</a></b>'
submenu[1]='<b><a href="//www.jb51.net/">北冥有鱼</a> | <a href="http://play.jb51.net">播放器之家</a> | <a href="http://sc.jb51.net/">素材之家</a> | <a href="http://mingzi.jb51.net/">个性名字网</a></b>'
var delay_hide=500
var menuobj=document.getElementById? document.getElementById("describe") : document.all? document.all.describe : document.layers? document.dep1.document.dep2 : ""
function showit(which){
clear_delayhide()
thecontent=(which==-1)? "" : submenu[which]
if (document.getElementById||document.all)
menuobj.innerHTML=thecontent
else if (document.layers){
menuobj.document.write(thecontent)
menuobj.document.close()
}
}
function resetit(e){
if (document.all&&!menuobj.contains(e.toElement))
delayhide=setTimeout("showit(-1)",delay_hide)
else if (document.getElementById&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhide=setTimeout("showit(-1)",delay_hide)
}
function clear_delayhide(){
if (window.delayhide)
clearTimeout(delayhide)
}
function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}
</script>
</body>
</html></td>
   </tr>
 </table>

您可能感兴趣的文章:

  • JS实现侧边栏鼠标经过弹出框+缓冲效果
  • js鼠标经过tab选项卡时实现切换延迟
  • 原生态js,鼠标按下后,经过了那些单元格的简单实例
  • JS+CSS实现鼠标经过弹出一个DIV框完整实例(带缓冲动画渐变效果)
  • js实现鼠标经过表格行变色的方法
  • js实现鼠标经过时图片滚动停止的方法
  • JS实现鼠标经过好友列表中的好友头像时显示资料卡的效果
  • javascript学习笔记(二) 鼠标经过时,改变div块的背景色的代码
  • Javascript实现的鼠标经过时播放声音
  • js实现图片显示局部,鼠标经过显示全部的效果
  • vue实现鼠标经过动画

《鼠标经过显示二级菜单js特效.doc》

下载本文的Word格式文档,以方便收藏与打印。