Lightbox 2 在弹出窗口的位置上的逻辑是什么?
Lightbox 2 在弹出窗口的位置上的逻辑是什么?
似乎当使用 Firefox 或 Chrome 时,它会显示在不同页面的不同位置。是否有任何设置可以使其在每个页面上显示在相同的高度以保持一致性?
它使用什么 CSS 或逻辑来确定定位?
What is the logic of Lightbox 2 on where to position the popup?
It seems that when using Firefox or Chrome it shows up in different places on different pages. Is there any setting to have it show at the same height on every page for consistency?
What is the CSS or logic it's using to determine positioning?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
它以什么方式显示在不同的地方,您想要的行为是什么,您能提供一个示例页面吗?
以下是脚本本身如何计算弹出窗口的顶部位置(lightbox v2.04,zip 下载,js/lightbox.js,第 229ff 行):
由于脚本使用 Prototype 的 document.viewport 对象,脚本将弹出窗口定位在当前滚动位置内的 10% 处,如下所示:
In what way does it display on different places, what is your desired behaviour, and can you give a sample page?
Here is how the script itself calculates the top position of the popup (lightbox v2.04, zip download, js/lightbox.js, lines 229ff):
As the script uses Prototype's document.viewport object, the script positions the popups at 10% inside the current scroll position, like this:
我知道这是一个非常古老的线程,但仍然是前 5 名谷歌结果。 IE/FF 给了我很好的结果,但 Chrome 却没有。为了使它们全部一致,
js/lightbox.js 的第 231 行
更改为“
不完全是所请求的内容,但现在页面是一致的”。
信息取自http://www.lokeshdhakar.com/forums/discussion/5494/fixed-display-position-problems-with-firefox-but-not-ie-on-tall-webpages/p1
I know this is a very old thread, but still top 5 google results. IE/FF gives me good results but Chrome doesn't. To get them all consistent,
line 231 of js/lightbox.js
was changed to
Not exactly what was requested, but the pages are consistent now.
Info taken from http://www.lokeshdhakar.com/forums/discussion/5494/fixed-display-position-problems-with-firefox-but-not-ie-on-tall-webpages/p1
在
lightbox.js
第 231 行中,将除法调整为 10 到 100,如下所示:document.viewport.getHeight() / 100
示例代码:
In line 231 at
lightbox.js
adjust division by 10 to 100 like this:document.viewport.getHeight() / 100
Sample code:
您可以尝试 Flowplayer:
http://flowplayer.org/tools/demos/index.html
您可以通过 CSS 文件将叠加层的位置和大小设置到您想要的任何位置。
You could try Flowplayer:
http://flowplayer.org/tools/demos/index.html
You can set the positioning and size of your overlay through the CSS file to wherever you want.