Click to See Complete Forum and Search --> : floating div over iframe in opera


walidaly
07-31-2006, 04:48 PM
not sure if it's javascript or css problem, although it works fine in IE and Firefox
opera always brings the iframe to the front
<div style="position:absolute; left: 1px; top: 1px; width: 100px; height: 100px;background:#00FFFF;border:#000000 1px;"></div>
<iframe src="http://google.com" style="height:300px;width:300px;" frameborder="1"></iframe>
if the div includes an iframe, it shows it infront of the 1st iframe

felgall
07-31-2006, 07:57 PM
In the same way that Internet Explorer always puts select lists in front of everything else, Opera does the same for iframes.

The only way to ensure that what you want to appear in front does appear in front is to hide any selects, iframes, and flash that it overlaps.

walidaly
07-31-2006, 08:41 PM
I thought I might use another iframe instead of div but is there a way that the floating iframe hide itself when clicking a link on its source page?

mrhoo
07-31-2006, 09:10 PM
if you put the iframe in its own absolutely positioned div you can
set the zIndex of the div -not the iframe, the div that contains the iframe.
This does not work for the select element in IE6 and below, however...

felgall
07-31-2006, 11:38 PM
if you put the iframe in its own absolutely positioned div you can
set the zIndex of the div to keep it behind or in front of other
elements with the same or overlapping coordinates.

This does not work for the select element in IE6 and below, however...


And doesn't work for iframes in Opera either.

walidaly
08-01-2006, 10:59 AM
yes..zindex doesn't work

mrhoo
08-01-2006, 01:49 PM
This page uses zIndex to move an iframe in a div from behind to in front of another element:

www.yankeeweb.com/z_ghost.html

It works in IE6+, mozilla 1+and Opera 8+, at least.

walidaly
08-01-2006, 02:21 PM
This page uses zIndex to move an iframe in a div from behind to in front of another element:

www.yankeeweb.com/z_ghost.html

It works in IE6+, mozilla 1+and Opera 8+, at least.
Not working in opera, plz test 1st :rolleyes:

felgall
08-01-2006, 04:38 PM
In Opera 8- iframes are assigned a zIndex of +infinity the same way that selects are in IE6-. The only solution is to hide the iframe when the div goes in front of it or put the div in an iframe of its own.

walidaly
08-01-2006, 07:11 PM
I doubt it's a zIndex problem or using "thediv.style.zIndex = theiframe.style.zIndex + 1" would have worked!