Skip to main content

Bug Tracker

Side navigation

#46 closed bug (fixed)

Opened July 07, 2006 04:46AM UTC

Closed July 17, 2006 03:48AM UTC

Last modified June 20, 2007 01:17AM UTC

.hide() appears to be broken?

Reported by: john Owned by:
Priority: major Milestone: 1.0
Component: core Version: 1.0
Keywords: Cc:
Blocked by: Blocking:
Description

I can no longer get anything hidden using 1.0a

e.g. $('#jq').find('div').hide();

and code that worked on the compressed version I had previously (Built Fri May 12 13:01:23 2006) no longer works - nothing hidden on page load, no error reported, just doesn't do anything (except show what it shouldn't by default).

The example page is here: http://www.plantdocs.biz/hideshow.htm

The outcome is different, I discovered when preparing the page,

between IE and FF.

Attachments (0)
Change History (1)

Changed July 17, 2006 03:48AM UTC by john comment:1

resolution: → fixed
status: newclosed

Alright, this was a multipart problem. One part mine, one part yours :) slideDown, hide/show/etc. now work as expected and it's in SVN.

However, there was a bug on your end in the following code, you had:

$('#jq'.find('div').hide();

which hid the div just inside of #jq AND all the divs inside of that div. Whenever you clicked the companies link it would tweak out because it was trying to expand a box that had 'no' content in it (all the content was hidden!).

So, to work around this, you should use this instead:

$('#jq > div').hide();

$('#jq a').click(function(){

var z = $("#jq > div");

if (z.is(':visible')) {

z.slideUp('slow');

} else {

z.slideDown('slow');

}

return false;

});

That, combined, will only toggle the top div - and not the top div and everything inside of it. Hope that helps!