资料
表格
制度
合同
管理
职场
经营
创业
范文
总结
计划
作文
文章
美文
词句
教程
模板
图片
字体
图标
办公
人事
财务
生产
管理资源吧首页
>>>
教程
>>>
编程
>>>
JavaScript教程
>>>
当鼠标移出灰色区域时候,菜单项怎么隐藏起来
<!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=utf-8" /> <title>无标题文档</title> <img src="/_New/_cj/myeditor/sysimage/space.gif" class="ewebeditor__script" _ewebeditor_fake_tag="script" _ewebeditor_fake_value="%3Cscript%20language%3D%22javascript%22%3E%20%0D%0Avar%20%24%3Dfunction(id)%7B%20%0D%0A%20%20%20%20return%20document.getElementById(id)%3B%20%0D%0A%7D%20%0D%0Afunction%20hover()%7B%20%0D%0A%20%20%20%20if(%24('hover').style.display%20%3D%3D%20'none')%7B%20%0D%0A%20%20%20%20%20%20%20%20%24('hover').style.display%20%3D%20''%3B%20%20%20%20%20%0D%0A%20%20%20%20%7Delse%7B%20%0D%0A%20%20%20%20%24('hover').style.display%20%3D%20'none'%3B%20%0D%0A%20%20%20%20%7D%20%0D%0A%7D%20%0D%0A%3C%2Fscript%3E"> <style> *{margin:10px; padding:0} #nav{border:#ccc 1px solid; height:25px; width:198px; text-align:center; line-height:25px; margin-bottom:0} #hover{ position:absolute; height:100px; width:200px; margin-top:-2px; text-align:center; background-color:#ccc; } </style> </head> <body> <div id="nav" onmouseover="return hover();" onmouseout="return hover();"><a href="##" _ewebeditor_ta_href="%23%23" >鼠标移上来</a></div> <div id="hover" style="display:none;" onmouseover="return hover();" onmouseout="return hover();"> <ul> <li><a href="javascript:void(null)" _ewebeditor_ta_href="javascript%3Avoid(null)">菜单一</a></li> <li> <a href="javascript:void(null)" _ewebeditor_ta_href="javascript%3Avoid(null)">菜单二</a></li> </ul> </div> </body> </html>
[Ctrl+A 全选 注:
如需引入外部Js需刷新才能执行
]
教程首页
更多教程