jQuery, hide a div without disturbing the rest of the page

前端 未结 6 488
难免孤独
难免孤独 2020-12-17 21:37

Consider the page as below (pseudocode)

&l
6条回答
  •  温柔的废话
    2020-12-17 22:02

    Add a container around the header, and style it with display:block and a fixed width/height. When you fade out the header, the container will preserve the space the header occupied.

    This way you have an element to bind the hover event to, for re-displaying the header after it's faded out. Once hidden, the header will not be able to receive its own hover events, so the container must receive them in its place.

提交回复
热议问题