Created
December 10, 2014 12:44
-
-
Save ghostwriter/ab335e225c1defba6fa7 to your computer and use it in GitHub Desktop.
On Firefox, offsetWidth and offsetHeight are undefined on a SVG element.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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