Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

make an element overflow out of an iframe [duplicate]

Possible Duplicate:
Is there a way to have content from an IFRAME overflow onto the parent frame?

Here is my issue: I have two types of dialog which (should) look and act the same. One loads content directly into the page, and one uses a iframe to load content. I have an element which I need to overflow out of the iframe and show completely on the page. This element is basically an enhanced select element built with a list (ul/li). How can I make this act as a select would inside an iframe and overflow the iframe?

The first thing that comes to mind is to put the select/list outside of the iframe and position it in the correct spot, though this will require communicating between the iframe and parent more than I would like. Ideally I'd like a solution that keeps the select/list in the iframe.

like image 422
aepheus Avatar asked May 02 '11 22:05

aepheus


2 Answers

You can't.

An <iframe> is an element containing a separate, distinct browser window (essentially).

Think of it literally like a window: when you look out of your window, the view of the outside stops at the windowframe.

This is in contrast to content inside, say, a scrollable <div>, which is more like a hand-held sheet of glass with some stuff painted on it and some other stuff stuck on with sellotape and hanging off over the edges.

like image 119
Lightness Races in Orbit Avatar answered Sep 29 '22 09:09

Lightness Races in Orbit


You could use php to load the page into your current page. A lot of people consider iframes bad practice. It would only take a couple lines of php to load the page elements, instead of an iframe, which is sometimes slower.

Here is how you would do it....

<?php
    include('file.html');
?>

You would put this line in a and contain it on the page just as you would with the iframe. You can use ajax/js to seamlessly change the content of the html and even load things from a server if you wish.

like image 39
Trevor Arjeski Avatar answered Sep 29 '22 08:09

Trevor Arjeski