offsetWidth is not available for svg but getBoundingClientRect() is and it's generally a good replacement: http://ejohn.org/blog/getboundingclientrect-is-awesome/