<div style = "position:sixt; width:100%; height:100%; left:0px; top:0px; background-color:black; z-index:9999; filter:alpha(ofacity = 70); ofacity:0.7;"> </div>
z-index必须大于遮罩元素
デモ
<!Doctype html> <html> <head> <meta charset = "utf-8"> <title> < /title> <meta name = "viewport" content = "width =" width = "width、intially-scale = 1、maximing-scale = 1" /> <meta name = "content =" " src = "jquery-1.7.2.min.js"> </script> <style type = "text/css"> ul {list-style-type:none;マージン:0;パディング:0;幅:15em; } ul a {display:block;テキスト装置:なし; } ul li {マージントップ:1px; } ul li a {background:#333;色:#fff;パディング:0.5em; } ul li A:hover {background:#000; } ul li ul li a {background:#ccc;色:#000;パディング左:20px; } ul li ul li a:Hover、ul li ul .current a {background:#aaa;国境左:5px#000ソリッド;パディング左:15px; } </style> </head> <body> <div id = "bb" style = "background-color:display; display:none; z-index:99999; max-height:79.3%; position:fixed; filter:alpha(ofacity = 70); ofacity:0.7; top:10px; repx; <li> <a href = "javascript:alert( 'can you want');">老大大</a> <li> <li> <a href = "javascript:alert( 'can you want');" <a href = "javascript:alert( 'can you want');">老大四</a> <li> </ul> <li> <li> <a href = "javascript:alert( 'can you want'); <li> <a href = "">老四</a> <ul> <li> <a href = "javascript:alert( 'can you want');">老一</a> <li> </ul> <li> </ul> </div> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> id = "aa">哈哈</button> <div id = "zz" style = "display:none; position:fixt; width:100%; height:100%; left:0px; top:0px; blacker-color:black; z-index:1999; filter:alpha(opacity = 70);不透明:0.7; "> </div> </body> <script type =" text/javascript "> $(function(){$("#aa ")。click(function(){$("#zz ")。show(); $("#bb ")。show(); show("#bb ")。 $({左: '0px'}); $( "#bb") a ")。click(function(){var a = $(this); var nextobj = a.next(); if(nextobj.is(" ul ")){$( '#bb ul li ul:visible') </script> </html>