Question : need to flash words on webpage

I have some simple pages that change slightly at specified times, 5pm, 7am, etc.

For example, before 5pm the user can enter comments but not after 5pm.

The screen "flips" at 5pm and displays permanently "comments closed", but it's barely noticeable. I'd like to flash "comments closed" like 10 times and then stop.

Answer : need to flash words on webpage

Try this, it will change the background color of the element iid you specify, should be easy enough for you to modify for your needs.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
<html>
  <head>
  <script>
    
    var tmrID=0;
    var fDiv;
    var oColor;
    var nColor;
    var flashnum=0;
    var flashdelay=500;
    var ntimes=10;
    var ccount=0;
    function FlashDiv(divid,backcolor)
    {
      nColor=backcolor;
      if (tmrID!=0) 
      {
        clearInterval(tmrID);
        fDiv.style.backgroundColor=oColor;
        tmrID=0;
      }
      fDiv=document.getElementById(divid);
      if (fDiv)
      {
        oColor=fDiv.style.backgroundColor;
        ccount=0;
        tmrID=setInterval(doFlash,flashdelay);
      }
    }
    function doFlash()
    {
      ccount++;
      if (ccount>=ntimes)
      {
        clearInterval(tmrID);
        tmrID=0;
      }
      //alert(fDiv.style.backgroundColor!=oColor);
      fDiv.style.backgroundColor=fDiv.style.backgroundColor!=oColor || tmrID==0?oColor:nColor;
    }
  </script>
</head>
<body onLoad="FlashDiv('mycontent','#FF0000');">
  <div id="mycontent">This is the content for the script</div>
</body>
</html>
Random Solutions  
 
programming4us programming4us