Originally Posted by felgall
runs BlinkText immediately and then the function the code expects that call to return gets queued to run three seconds later.
To have BlinkTest run after a three second delay you need to code it as:
Originally Posted by WolfShade
All I'm going to say is that <blink> was deprecated for a reason.
Ah, the 90's ... full of <blink>, glitz, and badly formatted websites! Yep, I know blink is depreciated, but this is for a work project and parts of it need to blink when certain time thresholds have been reached.
Originally Posted by Old Pedant
In any case, the code is horribly over-complex and could and should be simplified:
function blink( )
for ( var b = 1; b < 9999; ++b )
var div = document.getElementById("agent" + b )
if ( div == null ) return;
div.style.visibility = ( div.style.visibility == "hidden" ) ? "visible" : "hidden";
setInterval( blink, 3000 );
Now it works with any number of "agentNN" divs (or spans or whatever) *and* with any initial visibility per agentNN (provided the style is code inline).
That is, you could add
<span id="agent3" style="visibility: hidden;">wowser!</span>
And it would autmatically be blinked, as well, but in opposition to the blinks for agent1 and agent2, as given.
I see what you did there. Thank you.