SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict Resident Evil's Avatar
    Join Date
    May 2003
    Location
    Barrow
    Posts
    342
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Cell Color Changer

    Can Someone Write Me aShort And Easy, Cell Color Changer?

    Example:
    Code:
    On Mouseover
    
    <td bgcolor="#000000">WOWOW</td>
    
    On Mouseout
    
    <td bgcolor="#FFFFFF">WOWOW</td>

  2. #2
    . gdape's Avatar
    Join Date
    Jan 2002
    Location
    in the outskirts, and in the fringes
    Posts
    501
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if it were an href you could do it with css, but I found this one:

    Code:
    <script language="JavaScript">
    
    
    function setPointer(theRow, thePointerColor) {
    	if (typeof(theRow.style) == 'undefined' || typeof(theRow.cells) == 'undefined') {
    		return false;
    	}
    	
    	var row_cells_cnt = theRow.cells.length;
    	for (var c = 0; c < row_cells_cnt; c++) {
    		theRow.cells[c].bgColor = thePointerColor;
    	}
    
    </script>
    then

    Code:
    <table><tr bgcolor="#FFFFFF" onmouseover="setPointer(this, '#000000', '#000000')" onmouseout="setPointer(this, '#FFFFFF', '#FFFFFF')"><td>WOOWOO</td></tr></table>

  3. #3
    SitePoint Enthusiast kgish's Avatar
    Join Date
    Dec 2001
    Location
    Gouda, The Netherlands
    Posts
    64
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    A much easier way would be this:

    Code:
    <table><tr><td onmouseover="this.style.backgroundColor='#000';this.style.color='#FFF'" onmouseout="this.style.backgroundColor='#FFF';this.style.color='#000'">WOWOW</td></tr></table>
    Kiffin
    Your average future-famous kind of guy...


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •