Skip to content

Latest commit

 

History

History
59 lines (40 loc) · 1.32 KB

README.md

File metadata and controls

59 lines (40 loc) · 1.32 KB

Heartbeat

A generic heartbeat plugin for firing events on a set interval.

Getting Started

Download the production version or the development version.

In your web page:

<script src="jquery.js"></script>
<script src="dist/heartbeat.min.js"></script>
<script>
var hb = new HeartBeat({
    interval : 1000, // milliseconds between heartbeat events
    autostart : false, // autostart true | false (default)
    event : function(arr) {
        window._gaq.push(arr); // custom beat function
    }
});
</script>

Documentation

(Coming soon)

Examples

Delayed start

var hb = new HeartBeat({ autostart: false });

...

hb.start();

...

hb.stop();

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using grunt.

Also, please don't edit files in the "dist" subdirectory as they are generated via grunt. You'll find source code in the "src" subdirectory!

Release History

(Nothing yet)

License

Copyright (c) 2012 johnymonster
Licensed under the MIT, GPL licenses.