Alternating row colors and adding hover with javascript
Saturday, December 16th, 2006Keeping in my do-it-all-with-javascript theme, here’s something else I created in order to keep the javascript completely separate from the HTML from the more javascript stuff.
It was originally created for the purposes of adding the hover onmouseover, but I also decided to add the alternating row color at the same time.
To be completely anal, I’ll note that the hover is something that should be done with javascript (it pretty much has to be done in javascript anyways, and it’s less part of the presentation than an action), while the alternating colors should be purely CSS.
However, this makes page creation easier. I also remember having some problems with reading the background color style from the row object, so this makes it easy.
(more…)