开发者

How to have content pop out of iframe?

Say I have a menu which is initially 200px by 100px. I need to include it in an iframe but the problem is it is a dropdown menu and when it opens the menu gets cu开发者_Go百科t of since it is inside the frame. Is there a way to have it drop out of the frame?


If both the parent page and the page within your iframe are coming from the same domain, you can communicate between them via JS:

Possible Ways to Communicate Between iFrame and Parent Page across domains

The solution would be to, upon hover, send JS to the parent page and have the parent page then render the menu on top of the iframe.

That said, having to use a menu within an iframe that then pops out of the iframe seems to be not a technical problem as much as it is a visual design and layout problem.


No there is not. You will need to use a different approach, such as downloading the content of the frame on the server and inlining it in the parent page instead. Another possibility would be to float the parent page's content over the iframe and make the iframe larger.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜