Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/svg/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
svg动画是否可以在不丢失累积信息的情况下暂停?_Svg_Svg Animate - Fatal编程技术网

svg动画是否可以在不丢失累积信息的情况下暂停?

svg动画是否可以在不丢失累积信息的情况下暂停?,svg,svg-animate,Svg,Svg Animate,您可以不受限制地停止和重复动画,但如果重新启动不确定的动画,它将失去其累积值,并从初始值开始 也许我应该用一个例子来说明;以这个动画为例: <animate id="main" attributeName="transform" attributeType="XML" begin="startbox.click" dur="1s" end="endbox.cli

您可以不受限制地停止和重复动画,但如果重新启动不确定的动画,它将失去其累积值,并从初始值开始

也许我应该用一个例子来说明;以这个动画为例:

  <animate id="main"
    attributeName="transform" attributeType="XML"
    begin="startbox.click" dur="1s" end="endbox.click"
    from="rotate(0)" to="rotate(360)"
    additive="sum"
    accumulate="sum"
    fill="freeze"
    repeatCount="indefinite"
  />

使用animate元素设置变换动画无效,必须使用animateTransform。看

您应该向Opera报告您的测试用例,如果它以该UA为动画

  <animateTransform
    attributeName="transform" attributeType="XML"
    type="rotate"
    begin="startbox.click" dur="1s" end="endbox.click"
    from="0" to="360"
    additive="sum"
    accumulate="sum"
    fill="freeze"
    repeatCount="indefinite"
  />
但据我所知,使用SVG1.1不能以声明的方式执行。

它内置于SVG中

 SVGRoot.pauseAnimations();

我最初是用
rect.x
测试它的,但这更容易看到。我将研究JS,谢谢。注意play函数是unpauseAnimations()。我花了一段时间才找到SVG DOM接口的.MDN链接: