Object

Motion

The behavior whereby a component reacts to the motion of the user’s device.

Properties

type
string
(Required)

This behavior always has the type motion.

Discussion

When you apply the Motion behavior to a component, the component reacts to the movement of the device. For example, when the user tilts the device, the component moves in the same direction. This video shows an example of the motion behavior.

Example

{ "components": [ { "role": "figure", "behavior": { "type": "motion" }, "URL": "bundle://figure.jpg" } ]}

Relationships

Inherits From

See Also

Behaviors

About Component Behaviors

Learn how to affect components’ reactions to device motion and scrolling.

object Behavior

Properties shared by all the behaviors you can use to affect how components react to device motion and scrolling.

object BackgroundMotion

The behavior whereby the background of a component moves in the opposite direction from the motion of the device.

object BackgroundParallax

The behavior whereby the background of a component moves slightly slower than the user’s scroll speed.

object Parallax

The behavior whereby a component moves at a speed different from the scroll speed.

object Springy

The behavior whereby a component acts as if it is on a short spring.