根据Cookie24小时弹出层


 <!--<div class="hover-right-css">查看二维码</div> -->

<div class = "cov">
	<div class = "con">
			<p class = "ptitle">详细信息</p>
			<p>大家好大家好大家好大家好大家好大家好大家好大家好大家好大家好大家好大家好大家好大家好大家好大家好大家好大家好大家好大家好大家好大家好大家好大家好大家好大家好</p>
			<img width="100" src="XXXXX">
			<div onclick = "c1();" class = "dbt">确定</div>
	</div>
</div>
<style>
.hover-right-css{
	display: flex;
	justify-content: center;
	align-items: center;
	background-color:orange;
	width:100px;
	height:50px;
	position:fixed;/*fixed总是以body为定位时的对象,总是根据浏览器的窗口来进行元素的定位,通过"left"、 "top"、 "right"、 "bottom" 属性进行定位。*/
	right:0px;/*设置与右侧的距离*/
	bottom:50%;/*设置与底部的距离*/
	z-index:100;/*设置显示次序,数字越大显示越靠前*/
}
.cov{
	width:100%;
	height:100%;
	background-color:rgba(0, 0, 0, 0.5);
	z-index:1000;
	display:none;
	position:fixed;
	text-align:center;
	font-size: 16px;
	box-shadow:0px 0px 5px black;
	top: 0;
    left: 0;
    align-items: center;
	justify-content: center;
}
.con{
	z-index:1100;
	width:600px;
	height:300px;
	background-color:white;
	box-shadow: 0px 0px 15px black;
}
.ptitle{
	width:100%;
	height:35px;
	background-color:#3daae9;
	color:white;
	line-height:35px;
}
.dbt{
	border-radius: 5px;
    width: 70px;
	height:30px;
	background-color:#3daae9;
	line-height:30px;
	color:white;
	margin: 0 auto;
}
	
	
</style>
<script>


function c1(){
	$(".cov").hide();	
}

if(!getCookie('pgcms'))
{
	showCon();
	setCookie('pgcms',1)

}


//$(".hover-right-css").click(function (e) { 
//	showCon();
//});
    

function showCon(){
	$(".cov").css({
		'display':'flex'
	});	
}	


function setCookie(name,value)
{
	var Days = 30;
	var exp = new Date(); 
	exp.setTime(exp.getTime() + Days*24*60*60*1000);
	document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString();
}


function getCookie(name)
{
	var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)");
	if(arr=document.cookie.match(reg)) return unescape(arr[2]);
	else return null;
}


function delCookie(name)
{
	var exp = new Date();
	exp.setTime(exp.getTime() - 1);
	var cval=getCookie(name);
	if(cval!=null) document.cookie= name + "="+cval+";expires="+exp.toGMTString();
}
	
	
</script>
发布了65 篇原创文章 · 获赞 20 · 访问量 2084

猜你喜欢

转载自blog.csdn.net/weixin_43993175/article/details/104260348
今日推荐