Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how do I get text to blink in IE 1

Status
Not open for further replies.

ptukey

Technical User
Sep 23, 2002
33
US
I have tried the tag <blink> but that only works in Netscape. I was wondering if you could help me get my sentence to blink in IE. I would think it would be possible. Thanks for all your help in the past you all rock!
 
It doesn't work in IE. It's a Netscape only property.

And why do you want to use it anyway? It's so annoying. I'd stay away from it if I were you....


-Ken

&quot;Hey...Where are all the chicks?&quot; -- unknown
 
ptukey, IE no longer supports the <blink> syntax, and for good measure. That was one of the worse elements IE ever came up with.

If you want to catch the users attention, why not try a diff. color text, a scrolling marquee, or fading text??

[sub]Reality continues to ruin my life...[sub]
 
this brings back horror stories. [lol] not picking on you at all ptukey just remember how much crap was blinking when that tag went way out of control and was thankfully taken down.

you could imagine the eye strain when it's all blinking around you

_____________________________________________________________________
onpnt2.gif
[sub]
Hakuna matata!!
[/sub]
 
ptukey,

I completely agree with the comments of the other users. Blinking text is annoying and it looks unprofessional (IMHO).

However, if you still want to use it on your webpage here is some javascript & CSS which will do what you want. I must give credit to for this code.

Code:
<html>
<head><script type=&quot;text/javascript&quot;> 
<!-- 
var b_timer = null; // blink timer 
var b_on = true; // blink state 
var blnkrs = null; // array of spans 

function blink() { 
	var tmp = document.getElementsByTagName(&quot;span&quot;); 
	if (tmp){ 
		blnkrs = new Array(); 
		var b_count = 0; 
		for (var i = 0; i < tmp.length; ++i){ 
			if (tmp[i].className == &quot;blink&quot;){ 
				blnkrs[b_count] = tmp[i];
				++b_count;
			} 
		} 
	// time in m.secs between blinks 
	// 500 = 1/2 second 
	blinkTimer(500); 
	} 
} 

function blinkTimer(ival){ 
	if (b_timer){
		window.clearTimeout(b_timer); 
		b_timer = null; 
	} 
	blinkIt(); 
	b_timer = window.setTimeout('blinkTimer(' + ival + ')', ival); 
} 

function blinkIt(){ 
	for (var i = 0; i < blnkrs.length; ++i){ 
		if (b_on == true){ 
			blnkrs[i].style.visibility = &quot;hidden&quot;; 
		}else{ 
			blnkrs[i].style.visibility = &quot;visible&quot;; 
		}
	} 
	b_on =!b_on; 
} 
//--> 
</script>

<style type=&quot;text/css&quot;> 
.blink { 
font-size: 15px; 
color: red; 
display: inline; 
} 
</style>
<title>Blinking Text</title>
</head>
<body onload=&quot;blink();&quot;> 
This is a test of the <span class=&quot;blink&quot;>blinking text</span> thingy...which <span class=&quot;blink&quot;>blinks</span> (in theory)
</body>
</html>

Hope this helps,
-Ron

-We all play from the same deck of cards, it's how we play the hand we are dealt which makes us who we are.
 
quite a bit more complicated than <blink></blink>, eh?

-kaht

banghead.gif
 
Ah, yeah. And it won't even work if the user has javascript turned off (like so many people do these days).

BTW, thank you to whoever gave me the star! [bigsmile]
-Ron

-We all play from the same deck of cards, it's how we play the hand we are dealt which makes us who we are.
 
javascript turned off (like so many people do these days)

actually I think that should be the opposite. more people then ever have javascript enabled.

a rough average of only 10% having it disabled isn't much. although if you look at the world population, I guess it could mean something. [wink]

_____________________________________________________________________
onpnt2.gif
[sub]
Hakuna matata!!
[/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top