Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
CoffeeScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
README.md
rifraf.coffee
rifraf_todo.md

README.md

rifRAF

An animation controller that uses requestAnimationFrame to animate elements as a function of the browser's scroll position.

Can be instantiated like so:

$(el).rifraf([
  {
    property: 'translateX',             // css property
    start: '50px',                      // css property start value
    stop: '-280px',                     // css property end value
    scrollBegin: 55,                    // percentage of el on screen where animation should begin
    scrollEnd: 95,                      // percentage of el on screen where animation should finish
    easing: [0.645, 0.045, 0.355, 1]    // http://easings.net/
  }
]);

Supports animation on multiple CSS properties per element:

$(el).rifraf([
  {
    property: "scale",
    start: 3,
    stop: 0.8
  }, {
    property: "opacity",
    start: 3,
    stop: 0
  }
]);
Something went wrong with that request. Please try again.