• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 477
  • Last Modified:

Blinking text in javascript

Hi,
  I have a following javascript function for blinking of the text.

function Blink(layerName){
var i=0;
 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("Blink2('"+layerName+"')",500);
}


And I am calling this function three times as I want three texts to be blinking as follows.

<tr bgcolor="#cococo">
         <td class=tabletext width=299><div id="blinking1" style="position:relative; left:0; visibility:hidden" class="prem_hint">
        <font color="black" face=Arial size=1><%=Questions(p)%> 
         </div>
         <script language="javascript">Blink('blinking1');</script>
        </font></td>
     
         <td class=tabletext width=299><div id="blinking2" style="position:relative; left:0; visibility:hidden" class="prem_hint">
        <font color="black" face=Arial size=1><%=o_string(0)%> 
         </div>
         <script language="javascript">Blink('blinking2');</script>
        </font></td>
       
             <td class=tabletext width=299><div id="blinking3" style="position:relative; left:0; visibility:hidden" class="prem_hint">
        <font color="black" face=Arial size=1><%=Answers(p+1)%> 
         </div>
         <script language="javascript">Blink('blinking3');</script>
        </font></td>
           </tr>

But the problem here is that the three texts are blinking , but they are not blinking at the same time.They are blinking at different times which is very irritating. I want blinking to happen at the same time.
Please suggest me the solution over this problem.
0
VidyaDeshmukh
Asked:
VidyaDeshmukh
  • 4
  • 3
1 Solution
 
webwomanCommented:
Easy one - don't have them blink. It's annoying.
0
 
astacomCommented:

You haven't posted all of the related code for this problem.  The Blink function won't operate without NS4 and IE4, as well as layerRef and styleSwitch being set.

Post all of the relevant code and I might be able to help out!

0
 
webwomanCommented:
Please don't help. If they want it to blink and annoy their users that much (including possibly causing a seizure in some people) let them figure it out themselves. ;-)
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
astacomCommented:
While I agree that blink should be avoided, I'm interested in just solving the problem, not sharing my opinion. :-)  webwoman, you mentioned some people having seizures due to blinking text...that interests me.  Do you have any references documenting that?

0
 
webwomanCommented:
There are lots...
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnacc/html/ATG_AvoidFlashing.asp
Which says...
Solutions
Microsoft recommends that applications keep screens, text, objects, and other elements from flickering, flashing, or pulsating. However, if flashing elements must be included, use the system caret blink rate for adjusting or shutting off the flashing rate. Control Panel gives the user access to turning off the blink rate or to setting it within a range of 0.4 to 2.5 hertz (Hz), which corresponds to a flash interval of between 200 to 1200 milliseconds.

This section describes the cursor flashing solution and its effects on customers, assistive technology vendors (ATVs), and software developers.

And then there's...
http://virtualpet.com/vp/farm/pmonster/seizures/pmnews1.htm
http://epilepsyontario.org/faqs/seizures/photo.html
http://mypsp.tripod.com/design.html
http://www.jsiinc.com/SUBC/tip1300/rh1307.htm
http://lists.w3.org/Archives/Public/w3c-wai-er-ig/1999Oct/0032.html

if I keep going through the Google search results, I can come up with a LOT more.

It's well documented. And annoying, even if it DOESN'T trigger a seizure. But why risk it?
0
 
astacomCommented:
As I said, I agree that it is annoying, but I'm still interested in the problem, even if it's only for my own knowledge.  I didn't contest the potential for causing a seizure, I just was hoping that an actual study would be referenced easily somewhere, but most search results only repeat the same opinion that we share about it looking bad, distracting, etc.  I'm curious why other design choices that feature flickering, such as any animation (flash, java, animated gif, etc), don't get a bad rap as well.

My apologies for treating this like a message board when that isn't its purpose.  If you would like to discuss this further, please contact me via <a href="mailto:ricko@innocent.com">email</a>.  Thanks for the references!
0
 
webwomanCommented:
Check the epilepsy sites... they have the best info. It's a known fact that flashing lights can trigger seizures in susceptible individuals. It's not a new thing, which is most likely why there aren't many actual studies online -- they were done a LONG time ago, probably when fluorescent lights and TV/movies first came out. Those also 'flicker', though at a much higher rate than most people can discern.
0
 
jaysolomonCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

Accept: webwoman {http:#8176791}

Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

jAy
EE Cleanup Volunteer
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now