I have about 100 svg files, and for all I want to change the same thing. This is the original:
<svg version="1.1" id="Laag_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="460px" height="104px" viewBox="0 0 460 104" enable-background="new 0 0 460 104" xml:space="preserve">
And I want to change it like this:
<svg version="1.1" id="Laag_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
preserveAspectRatio="xMinYMin meet" viewBox="0 0 460 104" enable-background="new 0 0 460 104" xml:space="preserve">
My html code is:
<div id="main"><object width="100%" data="http://euclidthegame.com/mathexchange/7.svg" type="image/svg+xml"></object></div>
So I want to set height and width to default, and I want to add preserveAspectRatio="xMinYMin meet"
. Of course I could just edit all the files, but I would like to do this externally using, javascript,jquery or css. I'm not sure how I can change the attributes in an external svg.
Here is what I tried: http://jsfiddle.net/kasper90/vV7Y8/