aboutsummaryrefslogtreecommitdiffstats
path: root/src/doc.js
diff options
context:
space:
mode:
authorwout <wout@impinc.co.uk>2012-12-23 15:30:04 +0100
committerwout <wout@impinc.co.uk>2012-12-23 15:30:04 +0100
commit3266fd2b1782270b1f92f82c8e418b6e0279f274 (patch)
tree107771db935b9e71c90c333d67f308d57cb996a9 /src/doc.js
parentfe697ccde786eeeccffef99b8a6fea791a257a6d (diff)
downloadsvg.js-3266fd2b1782270b1f92f82c8e418b6e0279f274.tar.gz
svg.js-3266fd2b1782270b1f92f82c8e418b6e0279f274.zip
Added and exta wrapping div around svg element
Diffstat (limited to 'src/doc.js')
-rw-r--r--src/doc.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/doc.js b/src/doc.js
index 0669c52..644bdfd 100644
--- a/src/doc.js
+++ b/src/doc.js
@@ -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();