u1ui / parallax.attr

Make every element scrolling at different speed

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[u1-parallax] - attribute

Make every element scrolling at different speed

Features

  • fast!
  • easy API
  • works for dynamic added elements
  • lightweight < 4k minified

Usage

<div u1-parallax style="--u1-parallax-speed:1.1;">faster</div>
<div u1-parallax style="--u1-parallax-speed:1;">normal</div>
<div u1-parallax style="--u1-parallax-speed:0.9;">slower</div>
[u1-parallax] {
    background:var(--color-light);
    display:inline-block;
    padding:.5rem;
}

Install

<script src="https://cdn.jsdelivr.net/gh/u1ui/parallax.attr@x.x.x/parallax.min.js" type=module></script>

Demos

minimal.html
performance.html
test.html

Also interesting

Parallax scrolling Backgrounds https://github.com/nuxodin/parax-bg

About

  • MIT License, Copyright (c) 2022 (like all repositories in this organization)
  • Suggestions, ideas, finding bugs and making pull requests make us very happy. ♥

About

Make every element scrolling at different speed

License:MIT License


Languages

Language:HTML 65.8%Language:JavaScript 34.2%