我必须使用JavaScript旋转三个SVG对象,而不是使用<animation>
标记。树顶部的大明星旋转正确,但从其他人中我找不到中心坐标。JS与SVG:围绕其中心旋转SVG元素
这是继星和JS旋转:
star2.setAttribute("transform", "rotate(" + angle + " 2000 200)");
,这是SVG:
<defs>
<symbol id="stern">
<polygon points="1000 50 1100 310 850 160 1150 160 900 310 1000 50" fill="yellow" />
</symbol>
</defs>
<use id="stern2" xlink:href="#stern" transform="translate(500,600) scale(0.5)" onmouseover="rotate2();" onmouseout="stop();" />
这里是一个小提琴:
你的小提琴不工作。 –