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

getBoundingClientRect().top gives different value after resize #115

Open
robinbonnes opened this issue Apr 30, 2018 · 2 comments
Open

getBoundingClientRect().top gives different value after resize #115

robinbonnes opened this issue Apr 30, 2018 · 2 comments
Assignees
Labels

Comments

@robinbonnes
Copy link

robinbonnes commented Apr 30, 2018

After resizing the window, "el.getBoundingClientRect().top" gives a different value, so the parallax div has a wrong position after resize.

Does the applied transform affect getBoundingClientRect()? I was looking into getting the value without transform:

@robinbonnes
Copy link
Author

I fixed this by forcing the browser to fire the resize event:

window.dispatchEvent(new Event('resize'));

This is a workaround and it would be better if it gets fixed in the plugin. Or am I missing some setting?

@moeamaya moeamaya added the bug label May 20, 2018
@moeamaya
Copy link
Member

Glad you found a workaround. Any quick thoughts how this can be updated in the library?

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

No branches or pull requests

2 participants