javascript - Toggling(or Flashing) a particular cell in a Table for some time frame -


i have created table in html , make particular cell flashing(on , off ) sort of.can please let me know if possible using javascript.

<html>   <body>     <h4>two rows , 3 columns:</h4>       <table border="1" width="100%" height="400" align="top">         <tr style="height: 1">           <td>             <table width="100%" border="2" height ="100" align="top">               <tr>                  <td  bgcolor="#ffff00">1-1</td> <!-- r1c1 yellow -->                  <td>1-2</td>                 </tr>                <tr>                  <td>1-3</td>                  <td>1-4</td>                </tr>              </table>           </td>            <td>             <table width="100%" border="2" height ="100" align="top">                <tr>                  <td>2-1</td>                  <td>2-2</td>                 </tr>                <tr>                  <td>2-3</td>                  <td>2-4</td>                </tr>              </table>           <td>             <table width="100%" border="2" height ="100" align="top">                <tr>                  <td>3-1</td>                  <td>3-2</td>                 </tr>                <tr>                  <td>3-3</td>                  <td>3-4</td>                </tr>            </table>          </td>         </tr>        <tr style="vertical-align: top">          <td>            <table width="100%" border="2" height ="100">                <tr>                  <td>4-1</td>                  <td>4-2</td>                 </tr>                <tr>                  <td>4-3</td>                  <td>4-4</td>                </tr>           </table>          <td>            <table width="100%" border="2" height ="100">                <tr>                  <td>5-1</td>                  <td>5-2</td>                 </tr>                <tr>                  <td>5-3</td>                  <td>5-4</td>                </tr>              </table>           <td>               <table width="100%" border="2" height ="100">                <tr>                  <td>6-1</td>                  <td>6-2</td>                 </tr>                <tr>                  <td>6-3</td>                  <td>6-4</td>                </tr>              </table>           </td>         </tr>     </table>   </body> </html> 

in below image , row1 , col 1 , possible in javascript or html make flash/blink in yellow? image file

update i'm able flash cells , of them flash randomly, though have time same. want of them flash together(at same time) , go off , again flash , go off

you can create javascript function changes background color of desired cell. further can use setinterval() function call function after fixed amount of time.

var flag = true; function changecolor () {     if(flag==true){         document.getelementbyid("yourid").style.background="yourcolor 1";         flag=false;     }     else if (flag==false){     document.getelementbyid("yourid").style.background="yourcolor 2";     flag = true;     } } setinterval("changecolor()", timeinmillisec); 

Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -