View Single Post
Old 01-10-2013, 07:29 PM   PM User | #5
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,200
Thanks: 59
Thanked 3,996 Times in 3,965 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
Sure. Trivial.

Just change the highlightRow function. Rest all the same:
Code:
      function highlightRow( )
      {
          for ( var t = 1; t < trows.length; ++t )
          {
              trow = trows[t];
              if ( trow != this ) trow.className = "normal";
          }
          this.className = ( this.className == "highlighted" ) ? "normal" : "highlighted";
      }
See it? We always change all rows *except* the clicked-on one to "normal". Then we simply flip-flop the clicked-on row.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote