Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery countdown and redirect

Tags:

jquery

Is anyone know how to do this setting?

How can I make a jQuery countdown

I read the post and i tried the code by myself.

But no matter how I change my location. Its finally still go to redirect.php and I want to change the time from 10s to 130s.

I had changed the value as well. But no effect at all.

Any idea?

Thanks.

like image 971
user1343112 Avatar asked Dec 04 '22 16:12

user1343112


1 Answers

  var count = 130;
  var countdown = setInterval(function(){
    $("p.countdown").html(count + " seconds remaining!");
    if (count == 0) {
      clearInterval(countdown);
      window.open('http://google.com', "_self");

    }
    count--;
  }, 1000);
like image 88
gabitzish Avatar answered Dec 28 '22 22:12

gabitzish