Mozilla's getting a new look. What do you think? https://mzl.la/brandsurvey

from

此文件需要技術審查。看看您能幫什麼忙。

我們的志工尚未將此文章翻譯為 正體中文 (繁體) 版本。加入我們,幫忙翻譯!

« SVG Attribute reference home

This attribute indicates the initial value of the attribute that will be modified during the animation. When used with the to attribute, the animation will change the modified attribute from the from value to the to value.

Usage context

Categories Animation value attribute
Value <value>
Animatable No
Normative document SVG 1.1 (2nd Edition)

The exact value type for this attribute depend on the value of the attribute that will be animated.

Example

This example uses a value of 100 for the from attribute, making the shape animate starting from a width of 100.

<?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>

Elements

The following elements can use the from attribute

文件標籤與貢獻者

 此頁面的貢獻者: SueSmith, Jeremie, sebmozilla
 最近更新: SueSmith,