Bug Tracker

Modify

Ticket #46 (closed bug: fixed)

Opened 7 years ago

Last modified 6 years ago

.hide() appears to be broken?

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

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

comment:1 Changed 7 years ago by john

  • Status changed from new to closed
  • Resolution set to fixed

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!

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.