首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

from

该属性表示将在动画期间修改的属性的初始值。当与to属性一起使用时,动画会将修改后的属性从from值更改为to值。

用法上下文

Categories

Animation value attribute

Value

<value>

Animatable

No

Normative document

SVG 1.1 (2nd Edition)

该属性的确切值类型取决于将被动画的属性的值。

实例

此示例使用100作为该from属性的值,使形状动画从宽度100开始。

代码语言:javascript
复制
<?xml version="1.0"?>
<svg width="200" height="200"
  viewPort="0 0 200 200" version="1.1"
  xmlns="http://www.w3.org/2000/svg">
    
  <rect x="10" y="10" width="100" height="100">
    <animate attributeType="XML"
      attributeName="width"
      from="100" to="150"
      dur="3s"
      fill="freeze"/>
  </rect>
    
</svg>

适用元素

以下元素可以使用该from属性

  • <animate>
  • <animatecolor>
  • <animatemotion>
  • <animatetransform>

扫码关注腾讯云开发者

领取腾讯云代金券