当单击我的灯箱链接时 - 它会将页面内容移动到灯箱下方。我已将 z-index 放在我的灯箱的 css 上,但我认为这还不够。我不确定下一步需要走哪个方向。我试图将灯箱保持在页面内容的顶部。我不希望页面上的内容向下移动,我希望灯箱覆盖原始页面的内容。
我的 fiddle : http://jsfiddle.net/stillb4llin/zZvLG/
我认为我需要在 jquery 中创建另一个函数以插入到我放置 positionLightBox1() 的位置; (注释掉)
我还认为我的 CSS 有误。我想相信我对 CSS 有牢固的掌握,但我相信你不会!
Experience with jquery: I've been playing with jquery for a few weeks (editing code and making it work for me) and I've done some reading and have created a few fiddles. Right now I've felt comfortable enough to create this with the help of some of my experience and some stack overflow answers.
感谢您的评论。
最佳答案
只需在#lightBoxContent 上设置 position:absolute 而不是 position:relative
...这会将灯箱从“流”中移除,并防止它进一步向下插入其他页面内容。
关于jquery - 当灯箱内容打开时页面内容向下移动 - jquery,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11779982/