6

正如我们所见,当我们点击 Facebook 中的图片缩略图时,它会在叠加层中加载完整图片。我只是想知道这个工具到底是什么。

据我了解,这显然不是使用任何“jQuery modal”来显示图像,因为您可以看到覆盖占用屏幕并且滚动条根据覆盖的大小而不是页面本身进行调整,这不在jQuery 模态的案例。我还查找了一些模态,例如Eric martin 的简单模态,但没有运气。

有没有人知道有什么插件可以实现这种类似 Facebook 的效果?

4

1 回答 1

0

I expect Facebook have written their own client-side libraries for doing things, rather than using out-of-the-box plugins like jQuery modals.

Just by observing the behaviour I would expect their script

(a) checks the size of the widow (as popups will scale down to fill the viewport), then (b) checks the size of the image itself

... and, after leaving room for comments and ads / etc, figures out exactly what size to set the containing div for the overlay. The image itself is then scaled to fit within the available space.

Regarding having scrollbars inside the overlay itself, this can be achieved on any element with a fixed size (i.e. set height / width) using the css overflow: auto;. Any block element with that style will display scrollbars if the content is larger than the dimensions of the element.

于 2012-11-20T10:29:49.817 回答