I am in need a link that will flash every 500 milleseconds, for a duration of 5 seconds... I remember long ago having a link like this, but deleted it because one could only click it when it was visible. Is there a workaround for that?
+1
A:
There is a JavaScript function in Script.aculo.us to do that : Have a look on Effect.Pulsate
Cicatrice
2010-07-08 11:22:57
Could I recommend some strobe lights and a nice drum-n-bass beat to go with that text effect?
Lèse majesté
2010-07-08 11:24:42
*unce unce unce unce unce*
espais
2010-07-08 14:44:49
+1
A:
Try this:
<script type="text/javascript">
var col = new String();
var x=1;var y;
function blink()
{
if(x%2)
{
col = "rgb(255,0,0)";
}else{
col = "rgb(255,255,255)";
}
aF.style.color=col;x++;if(x>2){x=1};setTimeout("blink()",500);
}
</script>
<body onload="blink()">
<a id="aF" href="http://www.google.com"><b>*Google!*</b><br>
Sarfraz
2010-07-08 11:23:17
Thank you! that at least solved the problem i had previously where i could not click the link when the text was hidden :)
David
2010-07-08 11:28:18
added setTimeout("stopblink()",5000); to the bottom of your script... In stopblink() i simply changed the id aF and now it works as intended... Thanks again
David
2010-07-08 16:00:29
+1
A:
There is CSS
text-decoration: blink
but that will blink your link all the time, you would need some javascript to change the style after 5 seconds.
Redlab
2010-07-08 11:24:03
Yes, that is probably the best way to do it, but unfortunately, blink isn't supported by IE, Safari, or Chrome: http://www.w3schools.com/Css/pr_text_text-decoration.asp . It's part of CSS2, and browsers are supposed to support it, but add the option of disabling it to conform to WAI UAAG: http://www.w3.org/TR/UAAG/guidelines.html#tech-on-off-blinking-text
Lèse majesté
2010-07-08 13:41:11
A:
Remember to always keep usability for all users in mind. Especially if you're making something flash at a certain frequency. Just be careful.
sigint
2010-07-08 14:17:18