Contents

Parallax

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

Declaration

object Parallax

Properties

NameTypeDescription
type Requiredstring

This behavior always has the type parallax.

factornumber

The speed of the component, as a factor of the scroll speed. Use a value of factor between 0.5 and 2.0. Values outside this range are reset to the minimum or maximum value.

The parallax factor 1.0 is equal to the scroll speed.

A factor lower than 1.0 makes the component move more slowly than the scrolling speed.

A factor higher than 1.0 makes the component move more quickly than the scrolling speed.

Mentioned in

Discussion

When you apply the Parallax behavior to a component, the component moves at a different speed than the scroll speed. Use the factor property to set the speed of the component. This video shows an example of the parallax behavior.

Example

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

See Also

Related Documentation

Behaviors