Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Get real dimensions YUI
function getRealDimensions(node) {
var clone,
result;
if ( ! node ) {
return false;
}
clone = node.cloneNode(true).show().setStyle('visibility','hidden').appendTo('body');
result = {
width: clone.get('offsetWidth'),
height: clone.get('offsetHeight')
};
clone.remove(true);
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment