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

Initialize transform position on load #36

Open
stefaaan opened this issue Apr 22, 2022 · 2 comments
Open

Initialize transform position on load #36

stefaaan opened this issue Apr 22, 2022 · 2 comments

Comments

@stefaaan
Copy link

I have a problem when I use the parallax on the top of the page. When the page loads the transform attribute isn't added to the parallax window, this makes for shaky movement. When you to scroll it adds (in my case) 160px to the scrolling position. How can i fix this or can you update the app so it initializes when the backbax function is called

Screen.Recording.mp4

.

@magic-77
Copy link

magic-77 commented Jun 6, 2022

Hi @stefaaan same problem here too.
as a workaround i found this solution

.parallax-element {
    div[style*="position: absolute"] {
        transform: translateY(-50%);
    }
}

but it may be that you still notice a very small offset

@BenjaminBeck
Copy link

Or like this:

let instance = new Backpax('.imageparallax');
window.onload = function() {
	instance.run();
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants