源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

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

  • 时间:2020-02-16 19:55 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:实现局部遮罩与关闭原理及代码
[u]复制代码[/u] 代码如下:
//实现局部遮罩 <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>
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部