【发布时间】:2018-03-27 03:04:42
【问题描述】:
我正在为 html/svg 中的矩形设置动画。我还在 javascript 中创建了一个函数,我希望动画仅在调用该函数时开始。
这是我的代码:
<svg>
<rect onclick="rightSide()" id="rightGreen" x="512" y="0" width="100%" height="768" fill="black" display="block">
<animate id="openright"
attributeName="x"
from="512"
to="1536"
dur="5.5s"
repeatCount="1"
begin="indefinite"/>
</rect>
</svg>
一切正常,但是我需要在调用函数时启动它。?
【问题讨论】:
标签: javascript html svg jquery-animate