Tony Hale

Navigation

Skip navigation.

Search

Site navigation

Email conversation

FromTony Hale
ToMe
SubjectTrouble with MiniWindows transparency
Date20 September 2004 00:52
Dear Tarquin,

Your javascript tutorial has been very, very helpful to me.  Thank you 
very much for your attention to both details and the larger picture.  
It's all quite good.

I am writing today, however, to bestow more than praise (for which you 
are very deserving).  I am actually having trouble with your 
mini-windows script.  Specifically, I have found that certain controls 
-- namely, pull-down boxes -- persist in appearing on the top layer even 
when the mini-window hovers over it.  This is the behavior I see in IE6 
for PC under Windows XP.  I do not see this behavior in IE5 for Mac, 
however.  In Netscape 4.8 for Windows XP, the problem is more 
widespread, with textboxes hovering as well.  The page has no doctype tag. 

The URL (not to be publicized) is 
http://xxxxxxxx.xxxxx.xxx/xxx/xxxx/xxxxxxxx.xxxxxxx and you should know 
that the page is generated via PL/SQL.  This should have no real impact 
since the server is a standard Apache server.  I have left your 
mini-windows script unaltered.  The other scripts I used, such as your 
continents /country script, I have also left unaltered.

When/If you visit the URL, you can invoke the mini-window by clicking on 
the link for a 'setup' under 'Supplemental Options.'  As you move it 
around, you will notice that the pull-down boxes mysteriously float 
above the mini-window.  Can you think of the cause for this?

Btw, I have tried removing all references to CSS and this makes no 
difference relative to this problem.

Thank you very much for the ways you've already helped and for any 
further assistance you may provide,
Tony Hale
FromMe
ToTony Hale
SubjectRe: Trouble with MiniWindows transparency
Date20 September 2004 08:43
Tony,

I'm afraid this email may be a bit of a disappointment to you. This problem
is well known, and unfortunately has no easy solution.

Many browsers use the Operating System's widgets to make form controls.
Doing this means that the Operating System takes control of that piece of
screen space. Unfortunately, the Operating System has no concept of CSS
layers, so when a layer/positioned element hovers over the form control,
the widget still shows through as if it were in the top-most layer.

Netscape 4 is by far the worst offender, but most browsers on Windows will
do the same thing to some extent, and may also do the same on Linux or Mac,
depending on how they are written. The same is also true for the iframe
element, and any applets or plugins.

Now, for the solution ... if you can call it a solution.
The only way to avoid this bug is to set the visibility style to 'hidden'
for all form elements whenever a layer may be above them - and this
includes the mini-windows, since they are just glamourised layers. Netscape
4 will still ignore you - since it cannot set styles on input elements, and
even if it could, it still shows parts of the inputs anyway.

Unfortunately, it can be very difficult to work out when a layer may be
above the input so in general, this is not a solution. Alternatively, you
can hold the form in an element with either the visibility style set to
'hidden' or the display style set to 'none' (for Netscape 4 to pay
attention, it must be a positioned element - but it won't hide them
properly anyway) - and only make it visible again when the form is actually
going to be used.

Other than that, it's just a big mess, due to the browser vendors wanting
to save themselves some time by using Operating System widgets instead of
writing their own.


Wish I could help more, but I hope you can get something useful from that.

Mark 'Tarquin' Wilton-Jones - author of http://www.howtocreate.co.uk/
FromTony Hale
ToMe
SubjectRe: Trouble with MiniWindows transparency
Date20 September 2004 15:39
Thanks, Mark, for your clear and prompt explanation.  I now understand the
limitations of the use of miniwindows.  I will play with employing
visibility to work-around the problem.  I actually anticipated doing it
myself but felt there may be an easier way.  I guess not.

With many computers on our campus still using Netscape 4.7, this solution
may not be viable anyway.

Thank you very much,
Tony
FromTony Hale
ToMe
SubjectRe: Trouble with MiniWindows transparency
Date23 September 2004 06:30
Dear Mark,

I think I may have stumbled upon another bug related again to the widgets
problem. When the miniwindows are invisible in IE6 on WinXP, they are still
'present' in the sense that they inhibit entering any data under the area
they cover. One can click combo boxes since they always emerge to the fore.
But textboxes, while clearly visible, are un-clickable.  The same goes for
hyperlinks.  In other words, I have a link to open a miniwindow, but if the
hidden miniwindow is hovering over the link, the miniwindow cannot be
invoked.  Troubling.

Nevertheless, making the main webpage invisible while the miniwindow is
open was a great solution to the former problem we discussed.  No
difficulties there.

But unless I can solve this problem of interference, the miniwindows will
continue to be problematic.

A few workarounds occur to me.  I can program the miniwindows to be far,
far out of the way whenever hidden.  Then when invoked, they quickly assume
a position in the middle of the page or elsewhere that is readily viewable.
Another workaround is to render them as taking up no space unless they are
visible.  This latter solution may be impossible, I suppose.

So, I just wanted to make you aware of my travails.  Perhaps you can
publicize these problems so that someone else might benefit from the
knowledge.  Thank you very much for your excellent work and continued
support.

Yours,
Tony Hale
FromMe
ToTony Hale
SubjectRe: Trouble with MiniWindows transparency
Date23 September 2004 11:12
> When the miniwindows are invisible in IE6 on WinXP, they are still
> 'present' in the sense that they inhibit entering any data under the area
> they cover.

I cannot replicate this behaviour in any version of IE (I have 4, 5, 5.5, 6)
Which exact version are you using? Is it IE6 on Windows XP SP2 by any
chance (the only one I don't have access to).

I tried clicking links behind the hidden part of the windows. I tried
clicking on text inputs. I tried making the background elements absolutely
positioned, since I assume this is how you got rid of the widget virtual
z-index bug. Nothing reproduced what you said. If you are having problems,
there is an alternative that may solve them.

Within the functions hideMinWin and showMinWin, do something like this
right before the end of the function:

if( document.childNodes && (d=thisDiv.getElementsByTagName('DIV')[1]) ) {
  d.parentNode.style.display = 'none'; //for hideMinWin
  d.parentNode.style.display = ''; //for showMinWin
}

That should remove the main content part of the mini window completely from
the document while it is hidden. Any menus will still exist, but hopefully,
these would not take up enough space to be a problem.

If this works, I will release a new version of the script which includes
this extra fix.

I am still confused by this problem though. Since this would mean problems
for virtually all DHTML menus in existence. Could you give mine a try is
the same copy of IE, and tell me if they have problems if the menus had
been obscuring links:
http://www.howtocreate.co.uk/tutorials/jsexamples/showhidedelayarray.html

Do you have any unusual content in the mini windows? Like iframes, for
example? Or anything else unusual in your page that may cause this odd
behaviour?

> Nevertheless, making the main webpage invisible while the miniwindow is
> open was a great solution to the former problem we discussed.  No
> difficulties there.

good to hear you managed to make something work.

>  So, I just wanted to make you aware of my travails.  Perhaps you can
> publicize these problems so that someone else might benefit from the
> knowledge.

All emails I get relating to my scripts are publicised for this reason :)
http://www.howtocreate.co.uk/emails/

Cheers

Tarquin
FromTony Hale
ToMe
SubjectRe: Trouble with MiniWindows transparency
Date23 September 2004 20:39
> Is it IE6 on Windows XP SP2 by any chance

Yes, it is.

Sorry that I wasn't more plain about the operating system.
I included it in the original email, I believe, but failed to quote it.
[Ed. yes, but not the SP version - there were major changes in IE SP2]
It was not an individual computer, by the way.  I tried it out on five
different units -- but as you guessed, they had all been patched to SP2.
I hadn't considered that.  Our campus employs Netscape (4!) and different
versions of IE.  Netscape 4.7 failed and IE had this problem.  I will see
if I myself can replicate it on a non-patched computer to determine if
that is the deciding factor.

>   ... d.parentNode.style.display = 'none'; ...

Thank you for this advice. I will give it a shot. In the meantime, however,
I have simply placed the miniwindow beyond the screen measurements when
invisible.  This seems to be working thus far.

I'll let you know.

> Do you have any unusual content in the mini windows?

Nothing but forms: pull-downs, checkboxes, text inputs and text areas.  No
divs, iframes, etc.


Thanks.  I appreciate your help and will keep you apprised.

Best,
Tony
FromMe
ToTony Hale
SubjectRe: Trouble with MiniWindows transparency
Date24 September 2004 15:12
Tony,

I have managed to get a copy of XP SP2 installed. I cannot replicate this
problem. It must be something that you are doing on your page that
demonstrates this issue. I even tried putting various form elements and
links in the mini windows and seeing if there were problems when they
overlayed each other. In all cases, it worked correctly.

Is this page available online so that I can see the bug for myself? I may
be able to work out the cause (I will keep the address private).

Cheers

Tarquin
FromTony Hale
ToMe
SubjectRe: Trouble with MiniWindows transparency
Date25 September 2004 04:42
Mark,

Yes, the page is available.  The url is http://[etc.]

You will not notice the problem since I designed a workaround by rendering
each window as maximum.  This is preferable anyway.  In any case, you will
probably find something in the design that it causing this problem, I
suppose.

Thanks, and apologies for taking your time.

Yours,
Tony
FromMe
ToTony Hale
SubjectRe: Trouble with MiniWindows transparency
Date25 September 2004 20:00
Attachmenta demonstration of the bug
Woohoo!

Ok, it took me a while, but I finally managed to pin it down. Inside the
mini windows (which, you will remember, are basically just glamorised
layers/positioned elements), you have a table. The table has a caption.
That is important. When you have a caption on a table in a positioned
element, and the positioned element has the visibility style set to
'hidden', Internet Explorer 5.5+ will treat the table as if it were
visible. Even though you will not be able to see it, it will stop the mouse
from being able to interract with anything behind the table.

If you move the layer at any time after it has been created, the problem
disappears.

To summarise: remove the caption and the problem stops. If you move the
mini windows after you create them, the problem stops. I have attached a
minimal example demonstrating the bug.
FromTony Hale
ToMe
SubjectRe: Trouble with MiniWindows transparency
Date25 September 2004 20:02
Interesting.  I didn't know this.  But it still doesn't explain matters.  I
placed the hidden div in there after the problems were found.  It was a late
addition.
 
Thanks for looking but the problem must reside elsewhere.
 
-Tony
FromMe
ToTony Hale
SubjectRe: Trouble with MiniWindows transparency
Date25 September 2004 20:20
Tony,

no, the mini window is the hidden div.
in the mini window contents, you are putting the table with the caption.
FromTony Hale
ToMe
SubjectRe: Trouble with MiniWindows transparency
Date25 September 2004 21:48
Ah, I see.  Thank you for the clarification.

I will remove the caption and try to replicate the problem again.

I would never have guessed this as the problem (even though you may have
mentioned it somewhere)!  Thanks so much.
-Tony
This site was created by Mark "Tarquin" Wilton-Jones.
Don't click this link unless you want to be banned from our site.