Skip to content
Permalink
Browse files
Fixed some bugs with attribute handling.
  • Loading branch information
jeresig committed Aug 9, 2006
1 parent f2d4bff commit 6a50758086f2db26b12b12e8c58a42cbbd28a98a
Showing 1 changed file with 9 additions and 1 deletion.
@@ -241,7 +241,7 @@ jQuery.fn = jQuery.prototype = {
*/
attr: function( key, value, type ) {
// Check to see if we're setting style values
return key.constructor != String || value ?
return key.constructor != String || value != undefined ?
this.each(function(){
// See if we're setting a hash of styles
if ( value == undefined )
@@ -759,6 +759,12 @@ jQuery.extend({
return this.each( n, arguments );
};
});

jQuery.each( jQuery.macros.filter, function(i,n){
jQuery.fn[ n ] = function(num,fn) {
return this.filter( ":" + n + "(" + num + ")", fn );
};
});

jQuery.each( jQuery.macros.attr, function(i,n){
n = n || i;
@@ -1739,6 +1745,8 @@ jQuery.macros = {

css: "width,height,top,left,position,float,overflow,color,background".split(","),

filter: [ "eq", "lt", "gt", "contains" ],

attr: {
/**
* Get the current value of the first matched element.

0 comments on commit 6a50758

Please sign in to comment.