From: Meitar Moscovitz Date: Wed, 28 Jan 2009 16:25:15 +0000 (+0800) Subject: Add section documenting which attributes can be animated. X-Git-Tag: semver~99 X-Git-Url: http://git.roojs.org/?p=raphael;a=commitdiff_plain;h=c064e970ea3fc6cc3efb424e53772e693da31b32 Add section documenting which attributes can be animated. Signed-off-by: Dmitry Baranovskiy --- diff --git a/README.markdown b/README.markdown index 316daef..817ce4d 100644 --- a/README.markdown +++ b/README.markdown @@ -171,10 +171,35 @@ Linearly changes an attribute from its current value to its specified value in t ##### Parameters -1. newAttrs object A parameters object of the animation results. +1. newAttrs object A parameters object of the animation results. (Not all attributes can be animated.) 2. ms number The duration of the animation, given in milliseconds. 3. callback function \[optional\] +##### Attributes that can be animated + +The `newAttrs` parameter accepts an object whose properties are the attributes to animate. However, not all attributes listed in the `attr` method reference can be animated. The following is a list of those properties that can be animated: + +* cx number +* cy number +* fill colour +* fill-opacity number +* font-size number +* height number +* opacity number +* path pathString +* r number +* rotation number +* rx number +* ry number +* scale CSV +* stroke colour +* stroke-opacity number +* stroke-width number +* translation CSV +* width number +* x number +* y number + ##### Usage var c = paper.circle(10, 10, 10); diff --git a/reference.html b/reference.html index 1a6c5a8..3508304 100644 --- a/reference.html +++ b/reference.html @@ -170,10 +170,34 @@ c.attr({fill: "#000", stroke: "#f00", opacity: 0.5}); // using params object

Parameters

    -
  1. newAttrs object A parameters object of the animation results.
  2. +
  3. newAttrs object A parameters object of the animation results. (Not all attributes can be animated.)
  4. ms number The duration of the animation, given in milliseconds.
  5. callback function [optional]
+

Attributes that can be animated

+

The newAttrs parameter accepts an object whose properties are the attributes to animate. However, not all attributes listed in the attr method reference can be animated. The following is a list of those properties that can be animated:

+

Usage

var c = paper.circle(10, 10, 10);
 c.animate({cx: 20, r: 20}, 2000);