/ Published in: jQuery
adapted from the fantastic „Learning jQuery 1.3“ book
http://www.packtpub.com/learning-jquery-1.3/book
http://www.packtpub.com/learning-jquery-1.3/book
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
jQuery.extend(jQuery.expr[":"], { "css": function(element, index, matches, set) { var parts = /([\w-]+)\s*([<>=]+)\s*(\d+)/.exec(matches[3]); var value = parseFloat(jQuery(element).css(parts[1])); switch (parts[2]) { case "<": return value < parseInt(parts[3]); break; case "<=": return value <= parseInt(parts[3]); break; case "=": case "==": return value == parseInt(parts[3]); break; case ">=": return value >= parseInt(parts[3]); break; case ">": return value > parseInt(parts[3]); break; } } });