Fancybox jQuery: iframe vs ajax

徘徊边缘 提交于 2019-12-24 11:34:45

问题


Can someone explain the difference between loading content into Fancybox via iframe vs Ajax?

Also, is it possible to have a gallery (e.g. rel="gallery") with either iframed or Ajax'ed content?

thanks.


回答1:


When you use iframe mode, the opened page works as a totally separated and independent page from the calling page and it may have its own structure, functionality and styles. You could skip to open the page in fancybox and open it in a new window/tab.

On the other hand, using ajax mode, the opened content becomes part of the calling page DOM structure (normally as a html element like a <div>) and can inherit the styles, functionality and properties of the calling page.

Regarding :

is it possible to have a gallery (e.g. rel="gallery") with either 
iframed or Ajax'ed content?

... the answer is yes. You could combine in the same fancybox gallery, images, swf objects, inline content (from a hidden <div>), youtube videos, ajax content, iframed pages, pdf documents and hard-coded custom content inside the script.

Here is an example of a gallery that combines images and youtube videos.



来源:https://stackoverflow.com/questions/15821076/fancybox-jquery-iframe-vs-ajax

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!