【发布时间】:2018-05-11 02:34:25
【问题描述】:
正如page svg 动画时间线中所解释的,以 DOMLoad 事件开始。但是你可以通过timelineBegin="onStart"把它改成svg的负载。
我想使用 svg 作为预加载,它应该立即开始动画。 为什么我的动画还在等待 DOMLoad 事件:
<svg id="map" version="1.2" width="100%" viewbox="-2 -2 506.3302 339.85639" xmlns:svg="http://www.w3.org/2000/svg" timelineBegin="onStart">
<defs>
<radialgradient id="grad1" cx="0.65" cy="0.78" r="0.08" rx="0.5" ry="1">
<stop offset="0.8" style="stop-color: #1a1a1a; stop-opacity:1"></stop>
<stop offset="100%" style="stop-color:rgb(255,255,255);stop-opacity:1"></stop>
<animate id="map-animation" attributeName="r" dur="2500ms" from="0.08" to="1.2" fill="freeze"/>
</radialgradient>
</defs>
<path id="map" fill="url(#grad1)" d="m733.83-66.9...>
</svg>
【问题讨论】:
-
当前没有浏览器支持 SVG 1.2 tiny。
-
@RobertLongson 不幸的是,这似乎不包括在支持的孤立的、精心挑选的功能中(如you previously mentioned)。即使在普通的 SVG 中,它似乎也是一个非常明智的功能,但它似乎也没有成为 SVG 2。