我在body标签中有一张SVG图像,正在使用以下代码进行动画处理:
<clipPath id="left-to-right">
<rect x="0" y="0" width="0%" height="100%" >
<animate attributeName="width" values="0%;100%" dur="5s" fill="freeze"/>
</rect>
</clipPath>
我正在通过图像标签将.svg添加到body中,如下所示:
<body>
<div id="loading-container">
<img id="silhoutte" src="Images/Silhoutte.svg">
</div>
<div id="content">
/* Content in here */
<div>
</body>
< p > 在显示实际内容之前,SVG作为“加载”动画,以预加载/缓存一些高分辨率图像。 < /p >
< p > 我的困难在于尝试检测SVG动画的结束,以便显示内容div。如果可能的话,如何检测动画呢?< /p >
< p > 我愿意听取更好的建议,以使用我创建的动画SVG实现网页加载屏幕。< /p >
< p > 谢谢!< /p >