Skip to content

Instantly share code, notes, and snippets.

@ghostwriter
Created December 10, 2014 12:44
Show Gist options
  • Save ghostwriter/ab335e225c1defba6fa7 to your computer and use it in GitHub Desktop.
Save ghostwriter/ab335e225c1defba6fa7 to your computer and use it in GitHub Desktop.
On Firefox, offsetWidth and offsetHeight are undefined on a SVG element.
getSize : function () {
if (isBody(this))
return this.getWindow().getSize();
return {
x : this.offsetWidth || styleNumber(this, 'width'),
y : this.offsetHeight || styleNumber(this, 'height')
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment