<p class="sycode"> </p> <p class="sycode"> </p> <ol> <li> <script></script>" language="javascript"> </li> <li><script> </script></li> <li>$(function(){ </li> <li> var query = location.search; </li> <li> var equal_index = query.lastIndexOf("="); </li> <li> var result_index = query.indexOf("result"); </li> <li> var submit_index = query.indexOf("submit"); </li> <li> if(result_index != -1){ </li> <li> if(query.substring(equal_index + 1) == 'success') { </li> <li> $("#msg").text('保存成功'); </li> <li> pupopen(); </li> <li> } </li> <li> } </li> <li> if(submit_index != -1){ </li> <li> if(query.substring(equal_index + 1) == 'success') { </li> <li> $("#msg").text('上报成功'); </li> <li> pupopen(); </li> <li> } </li> <li> } </li> <li>}); </li> <li>function pupopen(){ </li> <li> $("#bg").css("display", "block"); </li> <li> $("#popbox").css("display", "block"); </li> <li> $(window).scroll(function(){ $(window).scrollTop(0); });// 禁止浏览器滚屏 </li> <li>} </li> <li> </li> <li>function pupclose(){ </li> <li> $("#bg").css("display", "none"); </li> <li> $("#popbox").css("display", "none"); </li> <li> $(window).unbind("scroll");// 恢复浏览器滚屏 </li> <li>} </li> <li> </li> <li><style> </style></li> <li> </li> <li>body{margin:0px;} </li> <li>#bg{width:100%;height:100%;top:0px;left:0px;position:absolute;filter: Alpha(opacity=50);opacity:0.5; background:#000000; display:none;} </li> <li>#popbox{position:absolute;width:300px; height:200px; left:50%; top:50%; margin:-200px 0 0 -200px; display:none; background:#FFFFFF;} </li> <li> </li> <li> </li> <li> </li> <li> </li> <li>终于搞定这个效果了,IE和FF,OP均可以~ </li> <li>先说原理:两个层,一个高度和宽度都是100%,另一个就是你要弹出的窗口的具体内容,半透明在IE中是用filter: Alpha(opacity=60);在非IE中用opacity:0.60; </li> <li> </li> <li> <div></div> </li> <li> <div> <center> <img alt="CSS弹出背景半透明窗口_html/css_WEB-ITnose" >" /> <span></span> </center> <li> <br><br><br> </li> <li> <img alt="CSS弹出背景半透明窗口_html/css_WEB-ITnose" >" width="70" style="max-width:90%" onclick="pupclose()" style="cursor:pointer"/> </li> <li> </div> </li> <li> </li> </ol> <p class="sycode"></p> <p class="sycode"></p> <p class="sycode"> </p> <p class="sycode"></p> <p class="sycode"></p> <p class="sycode"> </p> <p class="sycode"></p> <p class="sycode"></p>