Jump to content

Flashing text


OMEGA_RAZER

Recommended Posts

hello and I apologize as this is no doubt the wrong area for this but I've been looking around and all I can find is the < blink > tag. What I want to be able to do is on my page have a link hidden and then after a specific amount of time have it quickly flash so that it can be seen and then going back to being hidden but able to be clicked.I'd like to have more than one hidden link as well, one say after 30 seconds and another after 75 seconds and so on.Is there any way this can be done?Thanks in advance for any help.

Link to comment
Share on other sites

Is there any way this can be done?Thanks in advance for any help.
This can easily be done with javascript using setInterval(). However, if you're looking for a CSS solution, the only option is CSS3 animations, which could also easily do something like that, but as far as I know animations have only been implemented in webkit (chrome & safari) so far.Here's some javascript as an example:
var a = document.getElementById('your-link-id');a.style.color = 'transparent';//you could also substitute 'transparent' for the background color of the element its on top of to be more cross browser compatiblesetInterval(function() {    a.style.color = ''; //use the initial color defined in the stylesheet, thus showing the link   setTimeout(function() { a.style.color = 'transparent'; }, 1000); //hide the link again after a second}, 30000);

Link to comment
Share on other sites

This can easily be done with javascript using setInterval(). However, if you're looking for a CSS solution, the only option is CSS3 animations, which could also easily do something like that, but as far as I know animations have only been implemented in webkit (chrome & safari) so far.Here's some javascript as an example:
Hello, Thanks for the help but I can't seem to get it to work :)I have this in the head
<script type="text/javascript">function flash() {	var a = getElementById('qu1');	a.style.color = '#000000'; //you could also substitute 'transparent' for the background color of the element its on top of to be more cross browser compatible	setInterval(function() { 		a.style.color = '#FF0000'; //use the initial color defined in the stylesheet, thus showing the link		setTimeout(function() { a.style.color = '#000000'; }, 1000); //hide the link again after a second	}, 10000);}</script>

and I have flash() in the body's onload.I can still find the link because I know where it is but it doesn't seem to flash at all :)

Link to comment
Share on other sites

try adding flash() to the link's onLoad, or adding the onload to the document instead. I think the issue is that the function is being called (on the body) before the entire DOM has been created.

Link to comment
Share on other sites

try adding flash() to the link's onLoad, or adding the onload to the document instead. I think the issue is that the function is being called (on the body) before the entire DOM has been created.
I can't seem to get these to work either. I've tried window.onload and document.onload and nothing. I tried having the onload with the function and at the bottom of the body and both didn't work. I'm puzzled as to how it's not though...
Link to comment
Share on other sites

I can't seem to get these to work either. I've tried window.onload and document.onload and nothing. I tried having the onload with the function and at the bottom of the body and both didn't work. I'm puzzled as to how it's not though...
getElementById('qu1'); should be document.getElementById('qu1');.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...