Skip to content

el.offsetTop = 0 when el is hidden #2

@widoz

Description

@widoz

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions