Skip to content

Latest commit

 

History

History
36 lines (31 loc) · 784 Bytes

README.md

File metadata and controls

36 lines (31 loc) · 784 Bytes

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);
}