简体   繁体   中英

Issue with fixed menu at top of window

I have a menu that is added to the top of the page when a user selects an element on screen.

I have given it a higher z-index , but it still causes the page to scroll down a bit when an element is clicked.

Any ideas as to how to get around this?

Managed to fix the issue.

Because the element was being repositioned, it was being taken out of the document flow. This caused the page to jump upwards whenever this happened.

I fixed it by adding a container element with the same height as the element that is moved so now the jump does not happen because there is an element taking up the space vacated by the moved item.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM