打开页面自动弹窗

来源:互联网 发布:mac删除bootcamp引导 编辑:程序博客网 时间:2024/04/29 02:05
 $(document).ready(function(){
getUserflag();

});

function getUserflag(){
$.ajax({
url:"<%=request.getContextPath()%>/preremind?type=getUserflag",
type:"POST",
data:{},
typeData:'json',
success:function(json){
json = $.parseJSON(json);
       if(json.retCode == "R200"){
           if(json.retData=="false"){
setTimeout(mTip,2000);
           }
       }else{
         layer.msg(json.retMsg,1,3);
       }
  }
});
}
 
function mTip(){
$("#mWindow").slideDown();
}
 
function divClose(){
$("#mWindow").fadeOut();
if($("#tip").is(':checked')){
$.ajax({
url:"<%=request.getContextPath()%>/preremind?type=addOrUpdUserflag",
type:"POST",
data:{},
typeData:'json',
success:function(json){
json = $.parseJSON(json);
       if(json.retCode == "R200"){
       
       }
  }
});
}
}
 
function aOnclick(o){
if($("#tip").is(':checked')){
$("#tip").prop("checked",false);
}else{
$("#tip").prop("checked", true);
}
}


<div id="mWindow" style="text-align:center;right:30px;bottom:0px;background:#FFF;border:1px solid;border-color:#99bbe8;width:300px;height:200px;position:absolute;display:none">
<div id="tMessage" style="margin:0 auto;margin-top:10px;width:95%;height:70%">
<table style="width:100%;" id="message">
<caption>预警监测</caption>
</table>
</div>
<div id="noTip" style="width:100%;text-align:right;"><input type="checkBox" value="" id="tip" name="tip" /><a style="color:#003F8D;margin-right:20px;cursor:pointer" onclick="aOnclick(this)">今日不再提示</a></div>
<input style="margin:0 auto" type="button" value="确定" onclick="divClose()"/>
</div>

//相关样式设置

#mWindow{
filter: progid:DXImageTransform.Microsoft.Shadow(color='#aaaaaa', Direction=135, Strength=5);/*for ie6,7,8*/ 
background-color: #aaaaaa; 
-moz-box-shadow:2px 2px 3px 1px #aaaaaa;/*firefox*/
-webkit-box-shadow:2px 2px 3px 1px #aaaaaa;/*webkit*/
box-shadow:2px 2px 3px 1px #aaaaaa;/*opera或ie9*/
}