Text blinking jQuery

后端 未结 30 2020
我寻月下人不归
我寻月下人不归 2020-11-27 03:23

What is an easy way to make text blinking in jQuery and a way to stop it? Must work for IE, FF and Chrome. Thanks

30条回答
  •  天命终不由人
    2020-11-27 03:48

    Here you can find a jQuery blink plugin with its quick demo.

    Basic blinking (unlimited blinking, blink period ~1 sec):

    $('selector').blink();
    

    On a more advanced usage, you can override any of the settings:

    $('selector').blink({
        maxBlinks: 60, 
        blinkPeriod: 1000,   // in milliseconds
        onBlink: function(){}, 
        onMaxBlinks: function(){}
    });
    

    There you can specify the max number of blinks as well as have access to a couple of callbacks: onBlink and onMaxBlinks that are pretty self explanatory.

    Works in IE 7 & 8, Chrome, Firefox, Safari and probably in IE 6 and Opera (although haven't tested on them).

    (In full disclosure: I'm am the creator of this previous one. We had the legitimate need to use it at work [I know we all like to say this :-)] for an alarm within a system and I thought of sharing only for use on a legitimate need ;-)).

    Here is another list of jQuery blink plugins.

提交回复
热议问题