?
Solved

Blinking text in javascript

Posted on 2003-03-20
9
Medium Priority
?
457 Views
Last Modified: 2012-05-04
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
Comment
Question by:VidyaDeshmukh
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
9 Comments
 
LVL 19

Expert Comment

by:webwoman
ID: 8174038
Easy one - don't have them blink. It's annoying.
0
 

Expert Comment

by:astacom
ID: 8175079

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
 
LVL 19

Accepted Solution

by:
webwoman earned 80 total points
ID: 8176791
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Expert Comment

by:astacom
ID: 8176942
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
 
LVL 19

Expert Comment

by:webwoman
ID: 8178148
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
 

Expert Comment

by:astacom
ID: 8179152
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
 
LVL 19

Expert Comment

by:webwoman
ID: 8184804
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
 
LVL 16

Expert Comment

by:jaysolomon
ID: 10149043
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question