Skip to content Skip to sidebar Skip to footer

How To Scale Inline Svg

I want to scale inline SVG document in html. I have code like this: var svg_width = svg.attr('width'); var svg_height = svg.attr('height'); function resize(width, height) { svg

Solution 1:

I found quick hack, to replace svg with text of the svg to force redraw.

$.fn.xml = function() {
    return (new XMLSerializer()).serializeToString(this[0]);
};

$.fn.SVGRedraw = function() {
    return $(this.xml()).replaceAll(this);
};

Post a Comment for "How To Scale Inline Svg"