Welcome to JavaScripts.com where we bring you new scripts free for your site. Feel free to use any of our scripts on your site.

WebDevelopersVirtualLibrary is your open source reference site. Stop by to read articles & tutorials or contribute. Need you Development question answered, well check out our forums.


You can use this script for many objects as table:

   
   

Place this in a new file called colorfulObjectOnmouseover.js:

  var ColorCode=new Array("e0f1ee","d6efff","646560","ffffcc","66ccff", "99ffcc","c0c0c0","669999","999966");
  function ParaOver(CaoPhong) {
    CaoPhong.style.backgroundColor=ColorCode[Math.round(Math.random()*10)];
  }
  function ParaOut(CaoPhong) {
    CaoPhong.style.backgroundColor="transparent";
  }

Place this in the <head> tag:

  <script type="text/javascript" src="colorfulObjectOnmouseover.js"></script>

Place this in the <body> Tag:

  <p onmouseover=ParaOver(this) onmouseout=ParaOut(this)>Welcome to JavaScripts.com where we bring you new scripts free for your site. Feel free to use any of our scripts on your site.</p>
  <p onmouseover=ParaOver(this) onmouseout=ParaOut(this)>WebDevelopersVirtualLibrary is your open source reference site. Stop by to read articles & tutorials or contribute. Need you Development question answered, well check out our forums.</p>
  <br>
  <p>You can use this
  script for many objects as table:</p>
  
  <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" id="AutoNumber1" width="100%">
    <tr>
      <td onmouseover="ParaOver(this)" onmouseout="ParaOut(this)" width="50%"> </td>
      <td onmouseover="ParaOver(this)" onmouseout="ParaOut(this)" width="50%"> </td>
    </tr>
    <tr>
      <td onmouseover="ParaOver(this)" onmouseout="ParaOut(this)" width="50%"> </td>
      <td onmouseover="ParaOver(this)" onmouseout="ParaOut(this)"> </td>
    </tr>
  </table>
  <p>
  <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" id="AutoNumber1" width="60%" align="center">
    <tr>
      <td onmouseover="ParaOver(this)" onmouseout="ParaOut(this)" width="30%">&nbsp;</td>
      <td onmouseover="ParaOver(this)" onmouseout="ParaOut(this)" width="30%">&nbsp;</td>
    </tr>
    <tr>
      <td onmouseover="ParaOver(this)" onmouseout="ParaOut(this)" width="30%">&nbsp;</td>
      <td onmouseover="ParaOver(this)" onmouseout="ParaOut(this)">&nbsp;</td>
    </tr>
  </table>