modal appear behind fixed navbar

前端 未结 5 2182
生来不讨喜
生来不讨喜 2021-02-19 03:50

so i have bootstrap based site with fixed navigation bar (that follow you around the page at the top) and when i want to show modal popup, it appear behind those navigation bar,

5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-19 04:14

    This is too late to post the answer, however I've had a similar problem today with Modal popup and a navbar.

    Used javascript to set z-index of the navbar to zero when the popup is displayed and vice versa.

    Note: use whateverElement.style.zIndex = 0 instead of whateverElement.style.z-index = 0 as javascript handles - as subtraction operator.

提交回复
热议问题