自己写了一个弹出菜单,有间隙也可以
2014-05-08 14:40
169 查看
<!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> <style> #cont { width:100px; height:30px; border:solid 1px #ccc; float:left;} #footer { width:200px; height:100px; position:absolute; left:0px; top:50px; background-color:#f4f4f4; border:solid 1px #ccc; left:10px;} #footer.disable { display:none;} #cont2 { width:100px; height:30px; border:solid 1px #ccc; float:left; margin-left:10px;} #footer2 { width:200px; height:100px; position:absolute; left:120px; top:50px; background-color:#f4f4f4; border:solid 1px #ccc;} #footer.disable , #footer2.disable{ display:none;} </style> </head> <body> <div id="cont">内容</div> <div id="footer" class="disable">此处显示 class "footer" 的内容</div> <div id="cont2">测试</div> <div id="footer2" class="disable">此处显示 class "footer" 的内容</div> <script> var cont = document.getElementById("cont"); var foooter = document.getElementById("footer"); var cont2 = document.getElementById("cont2"); var foooter2 = document.getElementById("footer2"); var obj = new tanchu(cont,foooter); var obj2 = new tanchu(cont2,foooter2); function tanchu (yuan,mubiao){ var tiem ; var _this = this ; yuan.addEventListener("mouseover",function (){_this.show()}); yuan.addEventListener("mouseout",function (){_this.hide()}); mubiao.addEventListener("mouseover",function (){_this.show()}); mubiao.addEventListener("mouseout",function (){_this.hide()}); this.show = function (){ clearTimeout(tiem); mubiao.className = ""; } this.hide = function (){ tiem = setTimeout(function (){mubiao.className = "disable";},200); } } </script> </body> </html>
相关文章推荐
- 让一个程序托盘显示,并且右键托盘图标可以弹出菜单
- 让一个程序托盘显示,并且右键托盘图标可以弹出菜单
- 自己定义的弹出菜单
- 我创建了一个托盘图标,可以正常使用,点击右键打开菜单。问题是如果点击右键后不选择其中一个菜单项进行操作的话,它就总不消失。
- [程序]自己做了一个测试数据生成器 可以下载
- GreyFrame是一个遮罩弹出显示页面的JS类, 它可以允许你像在框架(如: frame和iframe)中打开一个链接.
- 自己动手实现一个守护进程,当控制台窗口关闭时还可以在后台运行。每隔一秒钟向my.log文件中插入一条记录
- spring ioc原理(看完后大家可以自己写一个spring)
- spring ioc原理(看完后大家可以自己写一个spring)
- 自己写了一个jQuery的弹出层,非常非常简单
- 一个弹出的树形选择菜单
- android中怎么把自己需要的app启动图标集中到一个弹出框中
- 分享自己编写的一个jquery日历控件,可以选择日期区间
- spring ioc原理(看完后大家可以自己写一个spring)
- MDWiki —— 一个可以自动生成左侧菜单并在线访问的工具
- 羡慕别人是无知(你是独一无二的,每个人都有自己的25亿秒,他人不能替你过,你也不能替他人过。),模仿别人是自杀(学习他人的优点可以,纯粹的去模仿他人就是自杀,杀死了自己,创造了一个别人的影子。每个人都有一本适合自己的一本书)
- 简单完整的代码,通过这个代码你将对RSA加密算法在Java中的实现方法有一个初步的了解,这个类,你可以直接使用,水平高的,就自己修改完善下代码。
- spring ioc原理(看完后大家可以自己写一个spring)
- spring ioc原理(看完后大家可以自己写一个spring)
- vc右键弹出托盘菜单 对应的消息函数内容可以减少置顶