<html>
<head>
<script language="javascript">
function initSvg(num) {
var root;
if(svg) {
if(svg.length) {
for(var i=0;i<svg.length;i++) {
root=svg[i].getSVGDocument().documentElement;//获取SVG DOM的根元素
svg[i].style.width=root.attributes.getNamedItem("width").nodeValue*num;//获得图象宽度信息,并乘以倍数。
svg[i].style.height=root.attributes.getNamedItem("height").nodeValue*num;//获得图象高度信息,并乘以倍数。
}
}
else {
root=svg.getSVGDocument().documentElement;
svg.style.width=root.attributes.getNamedItem("width").nodeValue*num;
svg.style.height=root.attributes.getNamedItem("height").nodeValue*num;
}
}
}
</script>
</head>
<body onLoad="initSvg(1.2)//放大1.2倍">
<embed src="xxx.svg" type="image/svg+xml" name="svg" pluginspage="http://www.adobe.com/svg/viewer/install/main.html" menu="false"
></embed>
……
</body>
</html>