I know that blinking is not very good. However...
I have a long complex HTML form with a number of required fields. In addition to highlighting empty text fields, I want to draw attention to them by flashing the question text, possibly in three seconds.
All javascript / css methods that I can find seem to drop when more than one such element is blinking or they are designed to keep the element blinking all the time.
Any suggestions to achieve this?
Method What replaces blinking text on a web page? seems redundant.
thank
Derek
I tried this (to blink each highlighted interval for a little over three seconds), but it only works with the first element that it called:
function blinkOn(span){
span.counter=0;
span.defColor=span.style.color;
span.alertTimerId =setInterval("blinkOnce('"+span.id+"')", 400 );
}
function blinkOnce(spanID){
var span=document.getElementById(spanID)
span.counter++;
if(span.style.color==span.defColor){
span.style.color='transparent'}
else{
span.style.color=span.defColor;
}
if(span.counter>8){
blinkOff(span);
}
}
function blinkOff(span){
clearInterval(span.alertTimerId);
span.style.color=span.defColor;
}
source