javascript - How to open a modal pop up after timer runs out? -
i beginner in javascript , writing js code web application stuck @ 1 point.
i have web page timer 5 seconds , after timer runs out expect modal popup.
i have written code here:
var count=-1; // -1 having delay of 1000ms var counter=setinterval(timer, 1000); //1000 run every 1 second function timer() { count=count+1; if (count >=6) //+1 req time have delay of 1000ms { clearinterval(counter); /////////////what code should go here modal pop up??/////////////////////// return; } document.getelementbyid("timer").innerhtml=count + " secs"; // watch spelling }
i want know code enable pop after timer runs out.
all need select modal (with jquery) , call modal()
method:
$("#mymodal").modal();
that invoke modal. i've modified fiddle give example here: jsfiddle example.
Comments
Post a Comment