<p class="sycode"> </p> <p class="sycode"> </p> <ol> <li><script type="text/javascript" src="<ww:url value='/js/jquery-1.8.3.min.js'/>" language="javascript"></script> </li> <li><script type="text/javascript"> </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></script> </li> <li><style type="text/css"> </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></style> </li> <li> </li> <li><body> </li> <li>终于搞定这个效果了,IE和FF,OP均可以~ </li> <li>先说原理:两个层,一个高度和宽度都是100%,另一个就是你要弹出的窗口的具体内容,半透明在IE中是用filter: Alpha(opacity=60);在非IE中用opacity:0.60; </li> <li></br> </li> <li><div id="bg"></div> </li> <li><div id="popbox"><center style="margin-top:70px;"><img src="<ww:url value='/image/correct.jpg'/>" /> <span id="msg"></span></center> </li> <li><br/><br/><br/> </li> <li><img src="<ww:url value='/image/ok.png'/>" width="70" height="35" onclick="pupclose()" style="cursor:pointer"/> </li> <li></div> </li> <li></body> </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>