Click to See Complete Forum and Search --> : blinking text


tweetie37
10-27-2003, 04:09 PM
Hi everyone:
I got this code from Javascript source for a blinking text. This is for one line. How can I add more text like this to my page? How do I relate them? Thanks & here is the code:
<SCRIPT LANGUAGE="JavaScript">
<head>
window.onerror = null;
var bName = navigator.appName;
var bVer = parseInt(navigator.appVersion);
var NS4 = (bName == "Netscape" && bVer >= 4);
var IE4 = (bName == "Microsoft Internet Explorer"
&& bVer >= 4);
var NS3 = (bName == "Netscape" && bVer < 4);
var IE3 = (bName == "Microsoft Internet Explorer"
&& bVer < 4);
var blink_speed=200;
var i=0;

if (NS4 || IE4) {
if (navigator.appName == "Netscape") {
layerStyleRef="layer.";
layerRef="document.layers";
styleSwitch="";
}else{
layerStyleRef="layer.style.";
layerRef="document.all";
styleSwitch=".style";
}
}

//BLINKING
function Blink(layerName){
if (NS4 || IE4) {
if(i%2==0)
{
eval(layerRef+'["'+layerName+'"]'+
styleSwitch+'.visibility="visible"');
}
else
{
eval(layerRef+'["'+layerName+'"]'+
styleSwitch+'.visibility="hidden"');
}
}
if(i<1)
{
i++;
}
else
{
i--
}
setTimeout("Blink('"+layerName+"')",blink_speed);
}
// End -->
</script>
</head>
<body>
<div id="prem_hint" style="position:relative; left:0; visibility:hidden" class="prem_hint">
<font color="#ffff00"><b>Attack Your Competitors!</b></font>
</div>
<script language="javascript">Blink('prem_hint');
</script>

Pselus
10-27-2003, 04:24 PM
can't you use the HTML <blink></blink> code?

AdamGundry
10-28-2003, 02:29 AM
From the Web Content Accessibility Guidelines (http://www.w3.org/TR/WAI-WEBCONTENT/#gl-movement):

7.2 Until user agents allow users to control blinking, avoid causing content to blink (i.e., change presentation at a regular rate, such as turning on and off).
Adam

tweetie37
10-28-2003, 09:09 AM
Thanks all. I got it figured out....