Object

BackgroundMotion

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

Properties

type
string
(Required)

This behavior always has the type background_motion.

Version 1.0

Discussion

When you apply the BackgroundMotion behavior to a component, the background of the component moves in the opposite direction of the device motion—much like the background image on an iPhone home screen. This video shows an example of the BackgroundMotion behavior.

Example

{ "components": [ { "role": "container", "behavior": { "type": "background_motion" }, "style": { "fill": { "type": "image", "URL": "bundle://summer.jpg", "fillMode": "cover", "verticalAlignment": "top" } }, "layout": { "minimumHeight": "77.2cw" } } ]}

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 BackgroundParallax

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

object Motion

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

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.