SVG的animate动画

箭头闪烁:

<polyline transform = "rotate(180.000,1072.00,212.00)" stroke="#FFFF00" stroke-width="5" fill="#FFFF00" points="1072.0 212.0,1112.0 212.0,1092.68 209.41,1092.68 214.59,1112.00 212.00">
    <animate attributeName="visibility" values="hidden;visible;hidden;visible;hidden;visible" dur="1s" begin="indefinite" end="indefinite" repeatCount="indefinite" />
</polyline>

圆形透明度改变:

<circle cx='200' cy='200' r='50' stroke='blue' stroke-width='0' fill='blue'> 
    <animate attributeName='fill-opacity'  attributeType='XML' begin='0s' dur='2s' from='1' to='0.4' fill='freeze' repeatCount="indefinite"/>
</circle>

圆形方形的转换:

<rect width="100" height="100">
    <animate attributeName="rx" values="0;50;0" dur="10s" repeatCount="indefinite" />
</rect>

官方文档:

https://developer.mozilla.org/en-US/docs/Web/SVG/SVG_animation_with_SMIL
attributeName:要设置动画的属性的名称。
from:属性的初始值。
to:最终值。
dur:动画的持续时间(例如,写“ 5s”持续5秒)。

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值