Skip to main content

Bug Tracker

Side navigation

#2575 closed bug (duplicate)

Opened March 23, 2008 12:02PM UTC

Closed January 11, 2009 03:37AM UTC

Hide does not "hide" non-visible elements

Reported by: ereze Owned by:
Priority: minor Milestone: 1.2.4
Component: core Version: 1.2.3
Keywords: Cc:
Blocked by: Blocking:
Description

if I try to do $("#B").hide() and the containing div "#A" is already hidden the action does not change the #B div to display:hidden. Later when I re-show() div #A, #B is displayed as well.

Of course, to workaround this, I had to remember to perform on #B before hiding #A.

<div id="A">

<div id="B">

</div>

</div>

Attachments (0)
Change History (4)

Changed April 11, 2008 03:35AM UTC by pelliott comment:1

Replying to [ticket:2575 ereze]:

if I try to do $("#B").hide() and the containing div "#A" is already hidden the action does not change the #B div to display:hidden. Later when I re-show() div #A, #B is displayed as well. Of course, to workaround this, I had to remember to perform on #B before hiding #A. <div id="A"> <div id="B"> </div> </div>

I just tried this code on the DOM you provided and everything was hidden and shown as expected. I added the letters "A" and "B" into the 2 divs so I could see exactly what was going on and stuck the alerts in for illustration of the progress. It appears as though it is working as expected and this is a non-issue with jQuery 1.2.3.

$(document).ready(function() {

alert("initial state");

$("#A").hide();

alert("A hidden");

$('#B').hide();

alert("B hidden"));

$("#A").show();

alert("A shown and B still hidden");

});

Changed May 06, 2008 03:31AM UTC by flesler comment:2

@ereze

Can you confirm this is solved ?

Changed May 16, 2008 07:05PM UTC by flesler comment:3

This seems to be related to the thing that $(':hidden') doesn't get element whose parents are hidden.

Changed January 11, 2009 03:37AM UTC by dmethvin comment:4

resolution: → duplicate
status: newclosed

This is a duplicate of #1349.