After three seconds countdown js- elastic block, automatically close.

effect:

js:

// pop-up window, three seconds countdown
countdown(){
// click the Publish button after three seconds countdown starts
$(".btn-pub").click(function(){
were count = 3;
was h = setInterval (function () {
count--;
if(count<0){
return;
}
$(".timeover")[0].innerHTML=count;
}, 1000)
setTimeout(function () {
clearInterval(timer)
h = null;
},3000)
$ ( "Timeover.") [0] .innerHTML = 3; // CPC into the initial number is 3

// After three seconds, automatically turn off pop
setTimeout(function(){
// console.log(565)
$(".publish").hide();
$(".popwindow").css({
"background": "rgba(0,0,0,0)",
"transform":"scale(0)"
})
$(".pop").css({
"opacity":0,
"transform":"scale(0)"
})
},3000)
})
 
 
}

Guess you like

Origin www.cnblogs.com/snowbxb/p/11847343.html