data-ix-scrolling

scrolling

Summary

This solution allows you to create create parallax animations where elements move or rotate based on scroll position. It's incredibly flexible as you get control over trigger elements, start and end values for each property, and more.

  1. Prefix
  2. Elements
  3. Options
Docs
All Solutions

01

Prefix

As with all attributes in this library all attributes in used when implementing this solution start with the following prefix: if you see the tag {prefix} used on this page it refers to the following prefix:

data-ix-scrolling

02

Elements

The scrolling solution relies on two core layers of divs in order to function, with an optional third element that can be used for more precise control over the scrolltrigger start and end points.

Attribute Name

Value

Default

Description

Copied to Clipboard

data-ix-scrolling=wrap

wrap

boolean

This is the outermost element of the solution that will hold any layer elements within it. By default this will be used to define the start and end points of the ScrollTrigger animation.

Copied to Clipboard

data-ix-scrolling=layer

wrap

boolean

This is the element that will be transformed during the animation. Since there is no 'default' animation to make this solution more flexible you will need to apply attributes to define what properties you are updating over the scroll animation. There can be multiple layer elements inside each wrap.

Copied to Clipboard

data-ix-scrolling=trigger

wrap

boolean

This is an optional element inside the wrap that you can use to have more specific control over the start and end points of the ScrollTrigger. If this element is inside the wrap it will be used as the trigger, otherwise the wrap will be used.

03

Options

Since this solution does not have a default interaction it relies much more heavily on option attributes. The first list of options will be applied to the wrap element, and the second list must be applied to a layer element.

FOR WRAPS

Attribute Name

Value

Default

Description

Copied to Clipboard

{prefix}-start

string

top bottom

A GSAP ScrollTrigger start parameter to dictate when the animation should start.

Copied to Clipboard

{prefix}-end

string

bottom top

A GSAP ScrollTrigger end parameter to dictate when the animation should end.

Copied to Clipboard

{prefix}-scrub

number

0.5

Sets the ScrollTrigger scrub value for the timeline. Changes how much of a delay there is for the timeline to catch up to the windows scroll position.

Copied to Clipboard

{prefix}-ease

string

none

The GSAP ease used for layers in the timeline be default.

Copied to Clipboard

{prefix}-tablet-start

string

null

A unique start parameter to dictate when the animation should start on the Tablet breakpoint (Will overwride desktop start value if the attribute is present.

Copied to Clipboard

{prefix}-tablet-end

string

null

A unique end parameter to dictate when the animation should end on the Tablet breakpoint (Will overwride desktop start value if the attribute is present.

Copied to Clipboard

{prefix}-mobile-start

string

null

A unique start parameter to dictate when the animation should start on the Mobile breakpoints (Will overwride desktop start value if the attribute is present.

Copied to Clipboard

{prefix}-mobile-end

string

null

A unique end parameter to dictate when the animation should end on the Mobile breakpoints (Will overwride desktop start value if the attribute is present.

FOR LAYERS

Attribute Name

Value

Default

Description

Copied to Clipboard

{prefix}-ease

string

none

The GSAP ease used for for this layer (will override the default ease).

Copied to Clipboard

{prefix}-position

string

<

A GSAP position parameter to dictate when the animation should start and end within the whole timeline (useful for having multiple layers within one wrap).

Copied to Clipboard

{prefix}-duration

number

1

The duration of this layer 's tween. Useful if you have multiple layers and want them to span different portions of the timeline.

Copied to Clipboard

{prefix}-opacity-start

number

null

Sets the start value for the gsap tween to animate opacity (eg 0)

Copied to Clipboard

{prefix}-opacity-end

number

null

Sets the end value for the gsap tween to animate opacity (eg 1)

Copied to Clipboard

{prefix}-x-start

string

null

Sets the start value for the gsap tween to animate translate X (eg 20%)

Copied to Clipboard

{prefix}-x-end

string

null

Sets the end value for the gsap tween to animate translate X (eg 0%)

Copied to Clipboard

{prefix}-y-start

string

null

Sets the start value for the gsap tween to animate translate Y (eg 3rem)

Copied to Clipboard

{prefix}-y-end

string

null

Sets the end value for the gsap tween to animate translate Y (eg 0rem)

Copied to Clipboard

{prefix}-scale-start

number

null

Sets the start value for the gsap tween to animate scale (eg 1.2)

Copied to Clipboard

{prefix}-scale-end

number

null

Sets the end value for the gsap tween to animate scale (eg 1)

Copied to Clipboard

{prefix}-scale-x-start

number

null

Sets the start value for the gsap tween to animate scale X (eg 1.2)

Copied to Clipboard

{prefix}-scale-x-end

number

null

Sets the end value for the gsap tween to animate scale X (eg 1)

Copied to Clipboard

{prefix}-scale-y-start

number

null

Sets the start value for the gsap tween to animate scale Y (eg 1.2)

Copied to Clipboard

{prefix}-scale-y-end

number

null

Sets the end value for the gsap tween to animate scale Y (eg 1)

Copied to Clipboard

{prefix}-width-start

string

null

Sets the start value for the gsap tween to animate width (eg 100%)

Copied to Clipboard

{prefix}-height-start

string

null

Sets the start value for the gsap tween to animate height (eg 50%)

Copied to Clipboard

{prefix}-height-end

string

null

Sets the end value for the gsap tween to animate height (eg 50%)

Copied to Clipboard

{prefix}-rotate-x-start

number

null

Sets the start value for the gsap tween to animate x rotation (eg 0)

Copied to Clipboard

{prefix}-rotate-x-end

number

null

Sets the end value for the gsap tween to animate x rotation (eg 180)

Copied to Clipboard

{prefix}-rotate-y-start

number

null

Sets the start value for the gsap tween to animate y rotation (eg 0)

Copied to Clipboard

{prefix}-rotate-y-end

number

null

Sets the end value for the gsap tween to animate y rotation (eg 180)

Copied to Clipboard

{prefix}-rotate-z-start

number

null

Sets the start value for the gsap tween to animate z rotation (eg 0)

Copied to Clipboard

{prefix}-rotate-z-end

number

null

Sets the end value for the gsap tween to animate z rotation (eg -90)

Copied to Clipboard

{prefix}-radius-start

string

null

Sets the start value for the gsap tween to animate border radius (eg 0vw)

Copied to Clipboard

{prefix}-radius-end

string

null

Sets the end value for the gsap tween to animate border radius (eg 20vw)

Copied to Clipboard

{prefix}-clip-start

string

null

Sets the start value for the gsap tween to animate a clipping mask — can use a clip mask value like a polygon with percent values, or the following keywords:

  • full
  • top
  • bottom
  • left
  • right
Copied to Clipboard

{prefix}-clip-end

string

null

Sets the end value for the gsap tween to animate a clipping mask — can use a clip mask value like a polygon with percent values, or the following keywords:

  • full
  • top
  • bottom
  • left
  • right

What's next

More Work by Caleb Raney

Portfolio
Blog