我有一個svg齒輪,我想圍繞它的中心點旋轉。我可以在不使用第三方(如raphael或d3)插件來查找中心點的情況下執行此操作嗎?從中心點旋轉SVG
<section id="figure-container">
<svg version="1.1" id="mod02-fig01" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="1636px" height="1089px" viewBox="0 0 1636 1089" enable-background="new 0 0 1636 1089" xml:space="preserve">
<path fill="url(#SVGID_3_)" d="M861.877,817.743l48.579-13.964l-7.37-53.131l-50.668-0.205c-6.911-20.96-17.356-40.357-30.65-57.468
l28.278-41.983l-39.8-35.961l-38.998,32.455c-18.266-11.33-38.604-19.688-60.366-24.367l-5.321-50.339l-53.605-1.963l-9.013,49.939
c-22.031,3.157-42.905,10.078-61.917,20.116l-36.422-35.13l-42.326,32.951l25.192,44.046c-14.449,16.146-26.22,34.773-34.573,55.207
l-50.406-3.492l-11.242,52.449l47.556,17.527c-0.713,22.521,2.492,44.267,9.005,64.574l-40.807,29.687l25.102,47.402l47.633-17.12
c13.507,17.151,29.889,31.965,48.459,43.687l-12.17,48.941l49.701,20.18l25.455-43.681c10.423,2.166,21.162,3.499,32.158,3.901
c11.245,0.411,22.298-0.163,33.08-1.629l22.132,45.302l51.042-16.485l-8.581-49.834c19.335-10.402,36.708-24.037,51.375-40.21
l46.137,20.505l28.504-45.438l-38.629-32.683C856.307,861.728,861.022,840.265,861.877,817.743z">
<animateTransform attributeType="xml"
attributeName="transform"
type="rotate"
from="0 470 675"
to="360 470 675"
dur="4s"
repeatCount="indefinite"/>
</path>
</svg>
爲什麼你不能使用變換旋轉。調用變換:使用間隔中的js進行旋轉。 – Bala
我寫了一篇關於這件事的博客文章:http://www.petercollingridge.co.uk/blog/svg-animation-rotating-elements –