JS通过设置cookie来控制弹出层,首次打开页面显示弹出层-创新互联
.infor-layer {
background: url('https://cache.yisu.com/upload/information/20200312/65/247787.jpg?150ac022a67') no-repeat top center;
width: 744px;
height: 407px;
position: fixed;
top: 50%;
left: 50%;
z-index: 9990;
margin-top: -203px;
margin-left: -372px;
display: none;
}
.infor-layer .sub-alltext{ width: 258px;
margin: 98px 0 0 210px;}
.infor-layer .sub-alltext h2 {
font-size: 24px;
color: #fff;
}
.infor-layer .sub-alltext p {
font-size: 16px;
line-height: 2;
margin-top: 10px;
color: #fff;
}
.infor-layer .layer-goto-btn {
background: url('https://cache.yisu.com/upload/information/20200312/65/247788.jpg?150ac022a65') no-repeat top center;
width: 225px;
height: 47px;
position: absolute;
bottom: 28px;
left: 50%;
display: inline-block;
margin-left: -163px;
}
.infor-layer .layer-goto-btn:hover {
background: url('https://cache.yisu.com/upload/information/20200312/65/247789.jpg?150ac022a66') no-repeat top center;
width: 225px;
height: 47px;
}
.infor-layer .close {
width: 25px;
height: 25px;
border-radius: 25px;
color: #04774a;
position: absolute;
font-size: 26px;
top: 53px;
right: 282px;
display: block;
border: 2px solid #04774a;
text-align: center;
line-height: 20px;
}
.markes {
background: #000;
opacity: 0.6;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=60)";
filter: alpha(opacity=60);
width: 100%;
height: 100%;
position: absolute;
left: 0;
top: 0;
z-index: 999;
display: none;
}
$(function(){
var t = 1000;
var cname = "cname5574";
setTimeout(function(){
var v = getCookie(cname);
if(v==undefined){
$(".infor-layer").show();
$(".markes").height($(document.body).height()).show();
document.cookie = cname+"=1";
}
},t);
$("#J_indexNoteClose").on('click',function(event){
document.cookie = cname+"=1";
$(".markes").remove();
$(".infor-layer").remove();
event.stopPropagation();
event.preventDefault();
return false;
});
function getCookie(name){
var cookie = document.cookie;
var a = cookie.split("; ");
for(var j=0,m=a.length;j var b = a[j].split("="); if(b[0].toLowerCase()==name){ return b[1]; break; } } } }); 另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。
分享文章:JS通过设置cookie来控制弹出层,首次打开页面显示弹出层-创新互联
当前地址:http://myzitong.com/article/jhjeg.html