-2

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?

4

1 回答 1

0

设法解决了这个问题。

因为元素被重新定位,它被从文档流中取出。每当发生这种情况时,这都会导致页面向上跳转。

我通过添加一个与移动元素高度相同的容器元素来修复它,所以现在不会发生跳转,因为有一个元素占用了被移动项目腾出的空间。

于 2012-11-27T14:10:26.800 回答