Javascript 如何在动画后隐藏svg元素
动画完成后,我试图在SVG中隐藏图像。我怎样才能做到这一点 以下是我迄今为止所做的:Javascript 如何在动画后隐藏svg元素,javascript,svg,Javascript,Svg,动画完成后,我试图在SVG中隐藏图像。我怎样才能做到这一点 以下是我迄今为止所做的: <svg version="1.1" xmlns="http://www.w3.org/2000/svg"> <g> <image id="image1" x="65" y="155"> /*Step1.Animation*/ <animate id="startid" dur="1.5s" attributeName="y"
<svg version="1.1" xmlns="http://www.w3.org/2000/svg">
<g>
<image id="image1" x="65" y="155">
/*Step1.Animation*/
<animate id="startid" dur="1.5s" attributeName="y" values="155; 135;" begin="indefinite" />
</image>
<image id="image2" x="75" y="5">
/*Step2.Animation*/
<animate id="move" dur="1.5s" attributeName="y" values="5; 20;" begin="startid.begin" />
/*Step3. Doesn`t working !!!*/
<animate dur="0.1s" attributeName="visibility" from="visible" to="hidden" begin="move.end" repeatCount="0" />
</image>
</g>
</svg>
/*步骤1.动画*/
试试这句话:
<animate dur="1" attributeName="opacity" from="1" to="0" begin="move.end" repeatCount="0" fill="freeze" />
/*步骤1.动画*/
/*步骤2.动画*/
/*第三步。不工作*/
您只需将不透明度从1设置为0,如下所示:
<animate dur="0.2s" attributeName="opacity" from="1" to="0" begin="move.end" repeatCount="0" fill="freeze" />
你想让别人帮你编码吗?或者你试过不起作用的东西吗?就是这样!非常感谢。非常感谢。填充class='freeze'-是我的问题!哦,是的,我完全忘了。谢谢
<animate dur="0.2s" attributeName="opacity" from="1" to="0" begin="move.end" repeatCount="0" fill="freeze" />