Use javascript to alternate row colors on tables and lists
Quick examples:
Lists:
new HighlightAlternate.list('vegi');
|
2 colors:
|
3 colors:
|
- carrot
- pepper
- onion
- green been
- celery
- lettuce
|
- carrot
- pepper
- onion
- green been
- celery
- lettuce
|
|
|
|
Table:
new HighlightAlternate.table('numbers');
NOTE: Try clicking a row.
| Number/Numero |
English |
Espanol |
| 1 |
One |
Uno |
| 2 |
Two |
Dos |
| 3 |
Three |
Tres |
| 4 |
Four |
Quatro |
| 5 |
Five |
Cinco |
| Number/Numero |
English |
Espanol |
Documentation
Coming soon, I hope.
Download
v0.2.0 (tarball)
NOTE: This is still beta code. As such the API is still subject to change (hopefully not much however).
NOTE: This library requires prototype.
Features
-
Easy to use and customizable API
-
Class based styling applied dynamically
-
Customizable style names
-
Degrades nicely so browsers without javascript enabled can still work.
-
Performs ruler highlighting on mouseOver
-
Highlights lists, and nested lists using: new HighlightAlternate.list(id);
-
Highlights tables using: new HighlightAlternate.table(id);
-
Clicking a row will select it, clicking again deselects
Licensing
BSD based license, download it and look at license.txt
Comments/Concerns?
Write to me at junk@thinkof.net.
Project colophon
Written by Greg Militello from Dyrect Media Group, LTD.
The idea for this came from alistapart.com's zebra tables, and table ruler.
Also a note should be made to the guys at the Rails spinoffs Mailing list.
They have been incredibly helpful. Thanks!
Change log
-
v0.2.0
-
Made the hover/click class dynamic so it can be set using options
-
v0.1.1
-
Fixed hover class application so that it works in IE (Todd Ross/Jeremy Kitchen/Jerod Venema)
-
v0.1.0
-
v0.0.1
Todo/bug list
-
Lists in IE do not highlight unless the mouse is over the text itself
Have a bug or a feature you want me to add? Email it to me at junk@thinkof.net.