Skip to content

DevWL/redirect-counter-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

This is simple pulse counter with redirection to some url using jQuery

```javascript var numberOfSecounds = 10; var urlToRedirectTo = "http://google.com"; gjCountAndRedirect(numberOfSecounds, urlToRedirectTo ); ```

Example of use: On click: https://jsfiddle.net/GlupiJas/k6prgpbw/

// USE EXAMPLE
$(document).ready(function() {
  //var
  var gjCountAndRedirectStatus = false; //prevent from seting multiple Interval

  //call
  $('h1').click(function() {
    if (gjCountAndRedirectStatus == false) {
      gjCountAndRedirect(10, document.URL);
      gjCountAndRedirectStatus = true;
    }
  });

});

On load: https://jsfiddle.net/GlupiJas/r29r1h0c/

// USE EXAMPLE
$(document).ready(function() {
  gjCountAndRedirect(10, document.URL);
}

About

count and redirect to url

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published