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