jquery - 当灯箱内容打开时页面内容向下移动 - jquery

标签 jquery css lightbox

当单击我的灯箱链接时 - 它会将页面内容移动到灯箱下方。我已将 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

http://jsfiddle.net/zZvLG/9/

...这会将灯箱从“流”中移除,并防止它进一步向下插入其他页面内容。

关于jquery - 当灯箱内容打开时页面内容向下移动 - jquery,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11779982/

相关文章:

javascript - Lightbox2 想要将标题移动到图像的右侧

javascript - Jquery ui slider 控件不更新值

javascript - 需要帮助理解代码

html - 如何在没有损坏页脚的情况下使用 div 获得三列文本布局?

javascript - 将两个兄弟从一个元素中分离回两个兄弟

javascript - 加载页面时显示重新加载框的灯箱

javascript - 为什么我的复制粘贴 Bootstrap 灯箱不起作用?

php - 如何将 CGRIDVIEW 中生成的表包含到 YII 中的 <DIV>

c# - 无法填充 Kendo Scheduler

css - 这个网站是用什么做的?