Monday, February 2, 2009

Peekaboo Bug: IE7

I ran across an ugly IE bug while developing a page layout. After some research it seems to be a crazy-making "peekaboo" IE bug.

Peekaboo (also spelled Peek-a-boo) is a game similar to hide and seek, but played with babies. In the game, one child, teenager, or adult hides their face, pops back into the baby's view, and says — to the baby's amusement Peekaboo! I see you!

Symtoms:
Certain content mysteriously disappears when you take some mouse action.

In my case it looks like this:










Cause
:
Setup of floating elements

Fix:
You have to set the "Layout" for the DIV element. You can set "Layout" in different manners eg. position, zoom, height,... attribute.

The hasLayout MS-property is a sort of flag: when it is set, the element has this layout “quality”, which includes special capabilities — for instance, on the floating and stacking — for the element itself and for its non-layouted child elements.

Some more information about hasLayout: The concept of hasLayout in IE/Win.

No comments: