Monday, November 21, 2011

Use JQUERY to blink Texts



<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script>
function startBlink(){
window.blinker = setInterval(function(){
if (window.blink) {
$('.blink').css('color','black');
window.blink=false;
}
else {
$('.blink').css('color','white');
window.blink = true;
}
},500);
}

startBlink();

</script>

...
<span class="blink"> Your texts here! </span>



This jquery assumes your background color is white and text color is black. You can change the appearance accordingly to suit your need. The interval is set at 500ms. Adjust the timing accordingly.

No comments:

Post a Comment