
Ever wanted to make some elements on your page flicker? Well, now that’s painless.
jQuery.blinker lets you show and hide elements to the rhythm you prefer. (See the examples below.)
Live examples
Basic usage
HTML:
<p>Hello there!</p>
JavaScript:
$("p").blinker();
jQuery.blinker options
timeHidden (number, default: 100)
Defines how much time the hidden state will last.
intervalRangeStart (number, default: 500)
intervalRangeStop (number, default: 2000)
Defines how much time the visible state will last.
Defaults to a random value from 500 to 2000ms.
jQuery.blinker methods
See the Live example #4 at the top of the page for a demo.
pause()
Want to stop the blinking for a while? Then use the pause() method.
var p = $("p"); p.blinker(); p.bind("mouseenter", function(){ $(this).data("blinker").pause(); });
blinkagain()
Use blinkagain() to resume blinking after pausing it.
var p = $("p"); p.blinker(); p.bind("mouseleave", function(){ $(this).data("blinker").blinkagain(); });
Note
jQuery.blinker makes use of jQuery.proxy, thus needs jQuery 1.4+.
Download
- jQuery.blinker 1.0 (02/11/2012): jquery.blinker.1.0.zip