Text Blinking with jQuery
Blinking text can be easily achieved using jQuery. Here's a code snippet that makes any text element with the class "blink" blink indefinitely:
$('.blink').each(function() {
var elem = $(this);
setInterval(function() {
if (elem.css('visibility') == 'hidden') {
elem.css('visibility', 'visible');
} else {
elem.css('visibility', 'hidden');
}
}, 500);
});
To stop the blinking, simply clear the interval associated with the text element:
$('.blink').each(function() {
var elem = $(this);
clearInterval(elem.data('blinkInterval'));
});
Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.
Copyright© 2022 湘ICP备2022001581号-3