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

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -