开发者

How to load pop-up of Iframe outside Iframe?

For example

I have a site www.site1.com and i'm using an iframe on a page of site1.com and source url of iframe is a page of www.site2.com.

Page of site2.com which is开发者_C百科 iframed on site1.com has some links which opens images in popup like lightbox.

On site1.com iframe has fixed width and height and i cannot extend further.

But the problem is iframe page has some popups are bigger than iframe's own width and height. So inside iframe popup shows vertical and horizontal scrollbar, which i don't want

Can popup load outside Iframe window with full height and width?


This will not work out because of the differing domains.

You would have to use "real" window.open pop-ups to break out of the iFrame.

If the iframe and the surrounding page are on the same domain, it will be possible, but most likely only with extensive JavaScript tweaks of your lightbox script. I know of no lightbox script that can show popups across frames out of the box. (It's not impossible one exists, though.)


jQuery and fancybox files should be loaded on both, the parent and the iframed page, however, it is enough to place the fancybox custom script in the iframed page only.

http://www.picssel.com/playground/jquery/fancyboxFromIframe_16Jan12.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜