Skip to content
Permalink
Browse files
jquery dimensions & offset: moving the local function 'num' to core, …
…so it can be safely used by both modules.
  • Loading branch information
flesler committed May 15, 2008
1 parent 1382ea8 commit 5a92ec2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
@@ -1359,3 +1359,8 @@ jQuery.each([ "Height", "Width" ], function(i, name){
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);
};

});

function num(elem, prop) {
return elem[0] && parseInt( jQuery.curCSS(elem[0], prop, true), 10 ) || 0;
}
});

0 comments on commit 5a92ec2

Please sign in to comment.