diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/doc.js | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -2,17 +2,22 @@ SVG.Doc = function Doc(e) { this.constructor.call(this, SVG.create('svg')); + // create extra wrapper + var w = document.createElement('div'); + w.style.cssText = 'position:relative;width:100%;height:100%;'; + // ensure the presence of a html element if (typeof e == 'string') e = document.getElementById(e); - // set + // set svg element attributes this. attr({ xmlns: SVG.ns, version: '1.1' }). attr('xlink', SVG.xlink, SVG.ns). defs(); - e.appendChild(this.node); + e.appendChild(w); + w.appendChild(this.node); // ensure this.stage(); |