Created
December 3, 2010 04:49
-
-
Save jonathanconway/726593 to your computer and use it in GitHub Desktop.
jQuery CSS filter
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
$.extend($.expr[':'], { | |
/// <summary> | |
/// Filters on whether the element has the same css property & value as specified. | |
/// Example: $('a:css(color:blue)') returns only links which are blue. | |
/// </summary> | |
css: function(element, index, params) { | |
var style = params[3].split(':'); | |
return element.style[style[0]] === style[1]; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment