Parallax

Rellax is a buttery smooth, super lightweight, vanilla javascript parallax library. Rellax works on mobile!

GitHub Rellax

Getting started

<div class="rellax">I’m that default chill speed of "-2"</div>
<div class="rellax" data-rellax-speed="7">I’m super fast!!</div>
<div class="rellax" data-rellax-speed="-4">I’m extra slow and smooth</div>

<script>
  // Accepts any class name
  var rellax = new Rellax('.rellax');
</script>

Centering

There’s two ways to implement centering, either on specific elements or as a global option.

<div class="rellax" data-rellax-percentage="0.5">
  I’m that default chill speed of "-2" and "centered"
</div>
<div class="rellax" data-rellax-speed="7" data-rellax-percentage="0.5">
  I’m super fast!! And super centered!!
</div>
<div class="rellax" data-rellax-speed="-4" data-rellax-percentage="0.5">
  I’m extra slow and smooth, and hella centered.
</div>
<script>
  // Center all the things!
  var rellax = new Rellax('.rellax', {
    center: true
  });
</script>