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

el.offsetTop = 0 when el is hidden #2

Open
widoz opened this issue Sep 14, 2017 · 0 comments
Open

el.offsetTop = 0 when el is hidden #2

widoz opened this issue Sep 14, 2017 · 0 comments

Comments

@widoz
Copy link

widoz commented Sep 14, 2017

I found that if an element is hidden for example using 'display: none'; the offsetTop of that element is 0.

This will cause the page to scroll on top.

I discovered it using WooCommerce that use the display property to hide the product tabs within the single product page.

WooCommerce tabs is one of the ui elements that show the content by clicking on an element. Like accordion.

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

1 participant