Bug Tracker

Opened 14 years ago

Closed 14 years ago

Last modified 13 years ago

#46 closed bug (fixed)

.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.

Change History (1)

comment:1 Changed 14 years ago by john

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!

Note: See TracTickets for help on using tickets.