Created
January 6, 2011 00:27
-
-
Save parrfolio/767298 to your computer and use it in GitHub Desktop.
jQuery Table Column Highlight
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// highlight columns by Christopher Clark | |
$("tbody").delegate("td", "mouseover mouseout", function (e) { | |
if (e.type == 'mouseover') { | |
// multiple class attr value support - the column identifier is always the first class value | |
var target = $(this).attr("class"); | |
if (target) { | |
target = target.split(" ").slice(0, 1).toString(); | |
$("col." + target).addClass("highlight"); | |
} | |
} else if (e.type == 'mouseout') { | |
$("col").removeClass("highlight"); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Updated version to use indexes. This pattern is from our locked column pattern.