开发者

What javascript code/library can I use to open a Pop up on browser window from a small iframe contained in the webpage?

I want to open a remote url inside a javascript popup instead of doing window.open(). I came across libraries like lytebox,lightbox,thickbox which do that if the popup is opened from main webpage. However my requirement is to open the popup from the link which occurs in a small iframe within the main page.( I can not alter the code of the m开发者_开发技巧ain page, however Iframe webpage is fully in my control) When I include those libraries in my iframe webpage, it opens the popup, but restricted only to within iframe.How to make it appear over whole browser window ? This is what i want : The user clicks on "click here" and it opens a javascript layer,not restricted to within iframe.

What javascript code/library can I use to open a Pop up on browser window from a small iframe contained in the webpage?


you can just use

parent.document 

from the iframe to access the parent window, if it is from the same domain. Otherwise, security concerns are raised.

You can inject the javascript by creating a script element in the parent's document, and then will be able to access the necessary functions.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜