mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
jquery dimensions & offset: moving the local function 'num' to core, so it can be safely used by both modules.
This commit is contained in:
parent
1382ea8d98
commit
5a92ec263d
@ -1359,3 +1359,8 @@ jQuery.each([ "Height", "Width" ], function(i, name){
|
|||||||
this.css( type, size.constructor == String ? size : size + "px" );
|
this.css( type, size.constructor == String ? size : size + "px" );
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Helper function used by the dimensions and offset modules
|
||||||
|
function num(elem, prop) {
|
||||||
|
return elem[0] && parseInt( jQuery.curCSS(elem[0], prop, true), 10 ) || 0;
|
||||||
|
}
|
@ -20,8 +20,4 @@ jQuery.each([ "Height", "Width" ], function(i, name){
|
|||||||
num(this, "margin" + tl) + num(this, "margin" + br) : 0);
|
num(this, "margin" + tl) + num(this, "margin" + br) : 0);
|
||||||
};
|
};
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
function num(elem, prop) {
|
|
||||||
return elem[0] && parseInt( jQuery.curCSS(elem[0], prop, true), 10 ) || 0;
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user