Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Display element outside of iframe

Is it possible to show poshytip from iframe so it is also displaying outside of iframe? Eg. like overflow: visible..

And if not, then how hard would be to display poshytip for parent document and position it relative to my content? What are browser security measures?

NB! Iframe has a fixed height!

Like so:

    +----------------------------+
    |         POSHYTIP           |
    |                            |
    |                            |
    |                            |
    +--\  /----------------------+
+-------\/---------------------------------------------------------+
|             IFRAME BANNER                                        |
|                                                                  |
|                                                                  |
+------------------------------------------------------------------+

Cheers!

like image 461
Kristian Avatar asked Sep 06 '12 12:09

Kristian


3 Answers

I think it's possible, but it not straightforward and simple. You can modify/extend the plugin that will appending the tooltip element to window.parent.body. Make it position absolute and calculate the position.

Of course it can be done if both frames/iframes not violates same origin policy.

like image 33
Alex Dn Avatar answered Nov 11 '22 02:11

Alex Dn


This is not possible. An iFrame is in essence a separate browser window inside document that references other pages. (As you said, it's an advertisement banner module.)

You'll have to place the tooltip to reference the iframe itself if you want a tooltip.

like image 63
Kyle Avatar answered Nov 11 '22 03:11

Kyle


Unfortunately, it's not possible.

<iframe> is another separate browser window. It's just a means of 'seeing' inside that web document through your parent document. It's different than a normal in which you can extend elements outside of its margins.

Also, it is considered a security vulnerability for other sites to be able to place content outside their given space.

like image 1
cassi.lup Avatar answered Nov 11 '22 01:11

cassi.lup