473,240 Members | 1,544 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,240 software developers and data experts.

Wierd zindex behavior

I'm using a div as a floating dialog box. I'd rather use a popup
window, but due to all the popup blockers in use, I have to use
another method, a div that has absolute positioning.

The damn thing won't get in front of dropdown listboxes! I
check the currentstyle.zindex of the listoxes, and they're
set at 0. I set the div.style.zindex to some higher number,
and it doesn't help. I minimize and restore the window,
hoping it will redraw correctly, but no luck.

IE 6. Bug. BAH!

Any suggestions?

TIA,
Jul 23 '05 #1
5 1496
On 1 May 2004 14:39:12 -0700, Razzbar <gl***@potatoradio.f2s.com> wrote:
I'm using a div as a floating dialog box. I'd rather use a popup
window, but due to all the popup blockers in use, I have to use
another method, a div that has absolute positioning.

The damn thing won't get in front of dropdown listboxes! I
check the currentstyle.zindex of the listoxes, and they're
set at 0. I set the div.style.zindex to some higher number,
and it doesn't help. I minimize and restore the window,
hoping it will redraw correctly, but no luck.

IE 6. Bug. BAH!


It's not restricted to IE, and there's nothing you can do about it. It's
simply how the browser (or OS, depending) renders the control.

Mike

--
Michael Winter
M.******@blueyonder.co.invalid (replace ".invalid" with ".uk" to reply)
Jul 23 '05 #2
Michael Winter wrote:
Razzbar wrote: <snip>
set at 0. ...
and it doesn't help. I minimize and restore the window,
hoping it will redraw correctly, but no luck.

<snip> It's not restricted to IE, and there's nothing you can do about it.
It's simply how the browser (or OS, depending) renders the control.


One proposed strategy for dealing with the way form controls show
through positioned DIVs is to set their visibility style property to
"hidden" on the controls. Either hiding all of the controls on a page
whenever the DIV is visible (which shouldn't be a problem if the DIV is
acting as a modal dialog), or comparing the control positions with the
offsets box of the DIV and hiding any controls that are overlapped by
the DIV (quite a lot of work to implement cross-browser), and
re-revealing them when uncovered.

Netscape 4 rather ruins that plan as it is not possible to individually
hide form controls and putting them in a positioned DIV/Layer and hiding
that influences how they are interpreted as part of any containing form.

Richard.
Jul 23 '05 #3
On Mon, 3 May 2004 15:43:28 +0100, "Richard Cornford"
<Ri*****@litotes.demon.co.uk> wrote:
One proposed strategy for dealing with the way form controls show
through positioned DIVs is to set their visibility style property to
"hidden" on the controls. Either hiding all of the controls on a page
whenever the DIV is visible (which shouldn't be a problem if the DIV is
acting as a modal dialog), or comparing the control positions with the
offsets box of the DIV and hiding any controls that are overlapped by
the DIV (quite a lot of work to implement cross-browser), and
re-revealing them when uncovered.


I tend to use IFRAME's as dividers, add to the DIV a firstChild which
is an empty iframe sized to the same size as the DIV.

Jim.
--
comp.lang.javascript FAQ - http://jibbering.com/faq/

Jul 23 '05 #4
Jim Ley wrote:
I tend to use IFRAME's as dividers, add to the DIV a firstChild which
is an empty iframe sized to the same size as the DIV.


This is indeed the best solution I've found. Iframes will always show over
select objects and other windows controls, so using them as "popups" seems
to be the best solution all-around (for browsers which support them).
I use this approach in a new version of a popup window library which I'm
testing and refining:
http://www.mattkruse.com/javascript/...ndow/temp.html

This solution tries to use the "best available" popup method if the user
doesn't specify one. If the browser is able to create new objects, then it
tries to create a DIV and populate it. Unless the page has select elements,
in which cases it tries to create an IFRAME and use it. It's not perfect,
and I haven't done full cross-browser testing, but I think in theory it will
work well, and hide all the implementation mess from a user who simply wants
a popup that behaves as expected.

--
Matt Kruse
Javascript Toolbox: http://www.mattkruse.com/javascript/
Jul 23 '05 #5
On Mon, 3 May 2004 10:34:43 -0500, "Matt Kruse"
<ne********@mattkruse.com> wrote:
This solution tries to use the "best available" popup method if the user
doesn't specify one. If the browser is able to create new objects, then it
tries to create a DIV and populate it. Unless the page has select elements,
in which cases it tries to create an IFRAME and use it. It's not perfect,
and I haven't done full cross-browser testing, but I think in theory it will
work well, and hide all the implementation mess from a user who simply wants
a popup that behaves as expected.


Ah, I don't use IFRAMES to actually hold the content, that makes
adding script to them difficult and means you have to load stylesheets
etc. into the IFRAME. I just use it as a divider:

so you get something like this:

<div>
<iframe src="javascript:'<html></body></html>"
style="position:absolute;z-index:-1;top:-1;left:-1;height:100px;width:100px;overflow:hidden;"></iframe>
Your popup content
</div>

Jim.
--
comp.lang.javascript FAQ - http://jibbering.com/faq/

Jul 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: JohnDpatriot | last post by:
After installing XP SP2 on my machine, I continually get the Script Error permission denied when I attempt to adjust the Zindex of an object on the page . see below ...
22
by: DJ WIce | last post by:
Hi, I'm looking for a script to get the hi-est z-index on a page. I want my javascript menu to be always on top of the page (moves along on top when you scroll down). Does anyone know how to...
6
by: Qun Cao | last post by:
Hello, I am just starting to play threading in python, here is a really interesting problem I am very curious about: " import thread def main(): thread.start_new(test.()) def test():
1
by: paul reed | last post by:
Hello, I am having some weird behavior between two machines...one which is running the 1.1 framework and one which is running 1.0. After opening a child form from a parent...I update the...
0
by: Tom | last post by:
OK, here's a wierd one... I have a listbox, which I fill with strings (in my case, file names). I normally load this via a loop, adding each item to the list box in the loop. I put lb.BeginUpdate...
3
by: Tom | last post by:
We are experiencing some wierd debugging behavior. What happens is that, during debugging with VS 2003, the debugger seems to 'skip' statements that are associated with database operations. For...
4
by: Muthu Arumugam | last post by:
Tried the following c# code static void Main(string args) { ArrayList list = new ArrayList(); int i = 10;
1
by: Sabbaath | last post by:
But haven't really found anything that answers the issue. Basically, I have a js function that has these lines in it, among others: var navSectionBg = document.getElementById("mainNav_" +...
1
Claus Mygind
by: Claus Mygind | last post by:
How come I can set this style element document.getElementById("popTime").style.left = "0px"; but not this document.getElementById("freqJobDiv").style.zIndex = "20"; I have two nested...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.