Forum Moderators: not2easy

Message Too Old, No Replies

Possible to make text blink, then disappear after 5 seconds?

Need something to come up while video loads

         

javahava

10:24 pm on Jun 22, 2005 (gmt 0)

10+ Year Member



Is it possible to make text disappear after a certain amount of time (e.g., 5 seconds)? Ideally, I'd like to make text that says "Please wait - video loading"; and have it blink for 5 seconds, then disappear. How could one do this using html/css? thanks!

BlobFisk

1:04 pm on Jun 23, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can achieve this using JavaScript and CSS (not the blink!). Set a Timeout and toggle the display of the container of the text to none - you can also use visibility and hidden.

Alternatively you could use an animated gif that blinks the text and then shows nothing (1 loop only).

javahava

1:39 pm on Jun 23, 2005 (gmt 0)

10+ Year Member



thanks for the tip about the disappearing text! i'm quite a novice at this kind of stuff - i found this line of code as a potential starting point - would i use something like this?

<script type="text/javascript">
<!--
setTimeout("alert('Thirty seconds has passed.');",30000);
// -->
</script>

how would i customize that to have text disappear after the 30 seconds?

BlobFisk

2:17 pm on Jun 23, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



<script type="text/javascript">

function hideText(textContainer) {
document.getElementById(textContainer).style.disply = 'none';
}

setTimeout("hideText('myHideText')",5000)

</script>

Then in your HTML:

<p id="myHideText">This text will hide after 5 seconds!</p>

I would recommend that you call the function at the end of your page or onload.

HTH

monkeythumpa

10:14 pm on Jun 23, 2005 (gmt 0)

10+ Year Member



An animated gif seems like the easiest way.