Skip to content

u1ui/parallax.attr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 

Repository files navigation

[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. ♥