O'Reilly logo

Learning Raphaël JS Vector Graphics by Damian Dawber

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Animation using custom attributes

Raphaël facilitates advanced animation via custom attributes . Custom attributes can be used to apply, or animate, multiple attributes on a particular element based on custom-defined logic.

Custom attributes

A custom attribute is a custom-defined function that returns a set of attributes to be applied to an element. It can be thought of as a helper function for which existing attributes are derived based on calculation. A custom attribute is defined as an attribute of the customAttributes namespace as follows:

Paper.customAttributes.yourAttribute = function(a1, a2, ...){};

Here, the a1, a2, ... arguments are numeric and yourAttribute is the name of the custom attribute. A custom attribute can then be used in the same ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required