Mobile Safari SVG(关于<pattern>)</pattern>

时间:2012-09-13 10:17:49

标签: ipad svg mobile-safari

当代码在ipad中运行时,pictrue上有一些线条(白色或黑色)。当我点击“缩放”按钮时,线条会移动。但是当代码在计算机中运行时是正常的。如何弄清楚问题?                     新文件                         

<body>
<script type="text/javascript">
function zoom(){
    var svg = document.getElementById("svg");
    var viewBox = svg.getAttribute("viewBox").split(",")
    svg.setAttribute("viewBox",[viewBox[0]-10,viewBox[1]-10,viewBox[2],viewBox[3]])
    console.info(viewBox)
}
</script>
<svg id="svg" width="500" height="500" xmlns="http://www.w3.org/2000/svg"  viewBox="-200,-200,500,500">
<defs>
<pattern id="raphael-pattern-0" x="0" y="0" patternUnits="userSpaceOnUse" width="116"  height="116">
<rect x="0" y="0" width="118" height="118" fill="green"/>
</pattern>
</defs>
<path  stroke-width="0" stroke-opacity="0" fill-opacity="1" fill="url(#raphael-pattern-0)" stroke="#000000" d="M204.610 -279.078 L204.610 170.922 L-245.390 170.922 L-245.390 -279.078 z"/>
</svg>

    <input type="button" value="ZOOM" onclick="zoom()">
</body>
</html>

0 个答案:

没有答案