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
取消
评论