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
+10
A:
For Example
$('.blink').blink(); // default is 500ms blink interval.
//$('.blink').blink(100); // causes a 100ms blink interval.
It is also a very simple plugin, and you could probably extend it to stop the animation and start it on demand.
barkmadley
2009-10-22 08:20:57
i'd use the blink-tag, and check with jQuery whether the browser is IE, and if not blink with this plugin.
Natrium
2009-10-22 08:43:11
that's more effort than it's worth isn't it?
barkmadley
2009-10-22 11:47:53
that is so true
Natrium
2009-10-22 13:24:30
barkmadley, how do I set stop for the blinking?
HP
2009-11-08 02:51:40
+1
A:
You can also try these:
<div>some <span class="blink">text</span> are <span class="blink">blinking</span></div>
<button onclick="startBlink()">blink</button>
<button onclick="stopBlink()">no blink</button>
<script>
function startBlink(){
window.blinker = setInterval(function(){
if(window.blink){
$('.blink').css('color','blue');
window.blink=false;
}
else{
$('.blink').css('color','white');
window.blink = true;
}
},500);
}
function stopBlink(){
if(window.blinker) clearInterval(window.blinker);
}
</script>
jerjer
2009-10-22 08:46:19
+1
A:
$(".myblink").css("text-decoration", "blink"); do not work with IE 7 & Safari. Work well with Firefox
jatin
2010-01-21 12:12:18
+1
A:
Unfortunately the text-decoration: blink is not supported by IE, Chrome & Safari
See http://www.w3schools.com/css/pr_text_text-decoration.asp
Note: The "blink" value is not supported in IE, Chrome, or Safari.
Jonas
2010-05-27 23:29:57