This project is archived and is in readonly mode.

#564 ✓invalid
hal10001

Setting visibility to hidden on parent/child divs must be explicit after explicitly setting both to visible

Reported by hal10001 | January 21st, 2009 @ 12:52 PM | in 2.0 (closed)

I'm not sure if this is a bug, but it seems to me an odd behavior that is not in line with how it should act if I were only to use classes that set the visibility of elements.


<div id="parent">
   My Parent
   <div id="child">My Child</div>
</div>

   $("parent").setStyle( "visibility", "visible" );
   $("child").setStyle( "visibility", "visible" );
   $("parent").setStyle( "visibility", "hidden" ); // child is still visible
   $("child").setStyle( "visibility", "hidden" ); // so i have to do this

The child in this case should not be visible, since the parent is not visible. In my production environment, the parent is absolutely positioned, and the child is not. In my live scenario I need to do it this way. Adding/removing classes that show/hide is not a possibility.

Comments and changes to this ticket

  • Valerio

    Valerio January 21st, 2009 @ 06:17 PM

    • State changed from “new” to “invalid”

    This is how css works, rather than a MooTools issue.

    MooTools doesnt want to "force" child visibility at all costs, but rather respect the css rules.

    In this case, your "problem" presents itself even by just using css:

    parent {

    visibility: hidden; }

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Shared Ticket Bins

People watching this ticket

Pages