1.1.2 • Published 9 months ago

jsyg-wrapper v1.1.2

Weekly downloads
51
License
MIT
Repository
github
Last release
9 months ago

JSYG

JSYG is a jQuery wrapper to work on svg elements.

var svg = JSYG("<svg>").attr({"width":400,"height":500}).appendTo("body");

var rect = JSYG("<rect>")
.attr({"x":50,"y":50,"width":100,"height":50})
.css("fill","red")
.addClass("MyClass");
.appendTo(svg);

rect.position(); // {left:50,top:50}
rect.offsetParent()[0] === svg[0] // true

svg.constructor === JSYG // true
svg instanceof jQuery // true

It doesn't work with html strings, only with single tags :

var rect = JSYG("<rect>").attr({width:500,height:200});
rect.isSVG(); //true;

var rect = JSYG("<rect width='500' height='200'/>");
rect.isSVG(); //false;
Installation with npm or bower
npm install jsyg-wrapper
bower install jsyg-wrapper
1.1.1

9 months ago

1.1.0

9 months ago

1.1.2

9 months ago

1.0.0

7 years ago

0.3.11

9 years ago

0.3.10

9 years ago

0.3.9

9 years ago

0.3.8

9 years ago

0.3.7

9 years ago