html弹窗代码只弹窗一次,信息弹窗提示一天只弹出一次js代码

信息弹窗提示一天只弹出一次js代码,通过jquery.cookie.js实现功能,避免重复弹出。

弹窗提示

*{

margin:0;

padding:0;

}

.alert_windows{

display:none;

position:absolute;

z-index:10;

width:400px;

height:300px;

background:#566F93;

}

.alert_windows span{

float:right;

width:30px;

height:30px;

text-align:center;

font:15px/30px Microsoft Yahei;

cursor:pointer;

color:#333;

background:lightblue;

}

.alert_windows span:hover{

color:#EEE;

background:red;

}

$(function(){

if($.cookie("isClose") != 'yes'){

var winWid = $(window).width()/2 - $('.alert_windows').width()/2;

var winHig = $(window).height()/2 - $('.alert_windows').height()/2;

$(".alert_windows").css({"left":winWid,"top":-winHig*2});//自上而下滑出

$(".alert_windows").show();

$(".alert_windows").animate({"left":winWid,"top":winHig},1000);

$(".alert_windows span").click(function(){

$(this).parent().fadeOut(500);

//以天为单位

//$.cookie("isClose",'yes',{ expires:1/8640});//测试十秒

$.cookie("isClose",'yes',{ expires:1});//一天

});

}

});

X

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值