Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing color on scroll #161

Closed
loranger opened this issue Oct 18, 2021 · 1 comment
Closed

Changing color on scroll #161

loranger opened this issue Oct 18, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@loranger
Copy link

lax.js 2.0.3

Describe the bug
I'd like to create a background color changing effect on scroll, but can't figure out where to start. Do you have any clue for me please ? Do I have to write a custom css function callback in order to compute the correct color depending on the scroll possition ?

Code

    lax.addElements(
      'body',
      {
        scrollY: {
          "background-color": [
            [0, 100],
            ['#FFFFFF', '#000000'],
          ]
        }
      }
    );
@loranger loranger added the bug Something isn't working label Oct 18, 2021
@alexfoxy
Copy link
Owner

Only specific CSS properties are possible, see https://github.com/alexfoxy/lax.js#css-properties

I suggest trying : hue-rotate or brightness

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants