html5弹出窗口遮罩层并倒计时关闭,Javascript弹出倒计时提示框的問題。倒计时提示框。倒计时提示框。倒计时提示框。...

htmlheadmeta charset=utf-8/title倒计时/titlescript src=jquery.js/scriptstyle body{ padding:0; margin:0; } .dd{ position:fixed; z-index:1; width:30%; height:240px; background:#eee; top:30%; left:30%; border-radius:10px; display:none; } .d{ position: absolute; border-radius:5px; background:green; width:100px; height:40px; color:#fff; text-align:center; border:0; left:42%; bottom:15px; } b{ color:red; } .c{ position: absolute; text-align:center; bottom:120px; left:42%; }/style/headbodydiv class=ab id=s13/blabel秒后弹出提示框/label/divdiv class=dddiv class=cb id=s210/blabel秒后将跳转/label/divbutton class=d确定/button/div/bodyscript type=text/javascript $(function(){var to1;var iv2;to1 = setTimeout(function(){$(.dd).fadeIn(slow);iv2 = setInterval(function(){$(#s2).text(Number($(#s2).text())-1);if($(#s2).text() == 0){clearInterval(iv2);alert(发送ajax请求);//这里发送请求// $.post(,{// },function(t,s){// });}},1000);},1000);//这里是10s,要5分钟就是1000*60*5if($(.dd).css(display)==block){clearTimeout(to1);}$(.d).click(function(){if($(#s2).text() != 0){$(.dd).hide();clearInterval(iv2);}});$(document).on(mousedown keydown, function(){console.info(点击了鼠标或键盘);clearTimeout(to1);clearInterval(iv2);});});/script/html

取消

评论

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值