作家
登录

实现局部遮罩与关闭原理及代码

作者: 来源:www.28hudong.com 2013-03-30 00:10:43 阅读 我要评论

复制代码 代码如下: //实现局部遮罩 <script type="text/javascript"> function Shade(){ var s = document.getElementById("shade"); s.style.display = "block"; } function Display(){ var d = document.getElementById("shade"); d.style.display = "none"; } </script> <style type="text/css"> #box{ width:400px; height:300px; position:relative; margin:0px auto; border:1px solid #000; } #shade{ width:400px; height:300px; background-color:gray; position:absolute; z-index:999; left:0px; top:0px; -moz-opacity:0.5;/*Firefox*/ opacity:0.5;/*Opera*/ filter:alpha(opacity=50); /*IE*/ } </style> </head> <body> <div id = "box"> <a href = "javascript:Shade()">局部遮罩</a> <div id = "shade"></div> </div> <a href = "javascript:Display()">遮罩消失</a> </body>

  推荐阅读

  JavaScript NodeTree导航栏(菜单项JSON类型/自制)

最近比较清闲,自己做了个JavaScript NodeTree,网上类似的东西其实挺多的,功能也比这个全,我做这个纯粹为了练练手。 图标可以自定义(16X16),菜单项完全是JSON类型定义的,方便修改。 界面: 使用方法: 1、将>>>详细阅读


本文标题:实现局部遮罩与关闭原理及代码

地址:http://www.17bianji.com/kaifa2/JS/22382.html

关键词: 探索发现

乐购科技部分新闻及文章转载自互联网,供读者交流和学习,若有涉及作者版权等问题请及时与我们联系,以便更正、删除或按规定办理。感谢所有提供资讯的网站,欢迎各类媒体与乐购科技进行文章共享合作。

网友点评
自媒体专栏

评论

热度

精彩导读
栏目ID=71的表不存在(操作类型=0)