jQuery plugin utilizing CSS Animations. Because we all loved the <blink> tag!
Modern Blink will use CSS Animations in browsers supporting them and fallback to jQuery Animations in older browsers.
Demo: http://codepen.io/leonderijke/pen/bkgxi
Heads up: This plugin is no longer being maintained. If you want to take over maintenance, please see this issue.
Include Modern Blink after the jQuery library:
<script src="/path/to/jquery.modern-blink.js"></script>
Or, install via Bower:
bower install modern-blink
Use Modern Blink like this on the desired elements:
$('.js-blink').modernBlink();
The following options can be passed to Modern Blink (defaults are shown):
$(element).modernBlink({
// Duration specified in milliseconds (integer)
duration: 1000,
// Number of times the element should blink ("infinite" or integer)
iterationCount: "infinite",
// Whether to start automatically or not (boolean)
auto: true
});
Modern Blink provides the following public methods:
$(element).modernBlink('start'); // Will start the animation
$(element).modernBlink('stop'); // Will stop the animation
Modern Blink will attach the following event listeners to the element:
$(element).trigger('modernBlink.start'); // Will start the animation
$(element).trigger('modernBlink.stop'); // Will stop the animation
Tested in:
- Chrome
- Safari
- Firefox
- Mobile Safari 5.1+
- Android browser 4.0+
- Internet Explorer 6+
MIT License