Advertisement
ssaidz

count.js - jQuery Redirect Timer

Jun 4th, 2016
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function counter(time, url){
  2.     var interval = setInterval(function(){
  3.         $('#waktu').text(time);
  4.         time = time - 1;
  5.  
  6.         if(time == 0){
  7.             clearInterval(interval);
  8.             window.location = url;
  9.         }
  10.     }, 1000);
  11. }
  12.  
  13. $(document).ready(function(){
  14.     counter(5, 'http://www.saidz.info');
  15. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement