diff options
Diffstat (limited to 'src/svg.js')
-rw-r--r-- | src/svg.js | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -27,7 +27,7 @@ SVG.did = 1000 // Get next named element id SVG.eid = function(name) { - return 'Svgjs' + name.charAt(0).toUpperCase() + name.slice(1) + 'Element' + (SVG.did++) + return 'Svgjs' + name.charAt(0).toUpperCase() + name.slice(1) + (SVG.did++) } // Method for element creation @@ -41,7 +41,7 @@ SVG.create = function(name) { return element } - // Method for extending objects +// Method for extending objects SVG.extend = function() { var modules, methods, key, i @@ -57,6 +57,12 @@ SVG.extend = function() { modules[i].prototype[key] = methods[key] } +// Method for getting an eleemnt by id +SVG.get = function(id) { + var node = document.getElementById(id) + if (node) return node.instance +} + // svg support test SVG.supported = (function() { return !! document.createElementNS && |