Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

setting a z-index value for an iframe?

33 views
Skip to first unread message

Patrick

unread,
Feb 4, 2002, 4:03:18 AM2/4/02
to
Hi,
as the subject says, is it possible to set a z-index value for an iframe? I
tried a div around it but it wouldn't work, other objects would still sit
over it. How do I set it to sit ontop?

Thanks,
Patrick.


David Best

unread,
Feb 4, 2002, 10:45:38 AM2/4/02
to
The following works for me in IE 5.5.

Regards,
David Best
www.bestdimension.com

<html>
<head>
</head>
<body>
<script type="text/javascript">
var gIndex = 1;
</script>

<iframe id="fooFrame"
style="position:absolute;top:10px;left:10px;
border:3px solid #ffb887;z-index:1"
>
</iframe>

<div id="fooDiv"
style="position:absolute;top:80px;left:30px;z-index:0;
height:200px; width:200px;background-color:#ff7f50;
border:1px solid #000000"
>
</div>

<div style="position:absolute;top:300px;left:10px;">
<button
onclick="document.getElementById('fooFrame').style.zIndex=++gIndex">
IFrame On Top
</button>

<button
onclick="document.getElementById('fooDiv').style.zIndex=++gIndex">
Div On Top</button>
</div>
</body>
</html>

Knud Gert Ellentoft

unread,
Feb 4, 2002, 10:45:57 AM2/4/02
to
Mon, 4 Feb 2002 22:03:18 +1300, skrev "Patrick"
<p.du...@paradise.net.nz>:

It should work in IE 6, I don't remember with IE 5.5.

<http://home13.inet.tele.dk/smedpark/test/iframe/index2.htm>

--
med venlig hilsen
Knud
http://home13.inet.tele.dk/smedpark/
Svar kun i nyhedsgruppen - tak! E-mails besvares ikke.

0 new messages