Bug Tracker

Ticket #11821 (closed bug: worksforme)

Opened 3 years ago

Last modified 3 years ago

slideUp doesn't work in display:none parent

Reported by: javiergarmon@… Owned by:
Priority: low Milestone: None
Component: effects Version: 1.7.2
Keywords: Cc:
Blocking: Blocked by:

Description

If you want to apply a slideUp effect to an element, the parent can't be hidden. I suppose that this is a bug, cause slideDown() works in this circumstances.

Tested in Firefox 12 and Chrome 19

It's very simple to simulate:

<div id="parent" class="display:none"> <p>Hello world</p> </div>

<script>

$('p','#parent').slideUp(200);

setTimeout(function(){ $('#parent').show(); },1000);

</script>

Change History

comment:1 Changed 3 years ago by sindresorhus

  • Priority changed from undecided to low
  • Resolution set to worksforme
  • Status changed from new to closed
  • Component changed from unfiled to effects

Works as intended. You slideUp the <p> and then try to show the parent, which will obviously show nothing since the <p> is still hidden. You can do $('#parent, p').show(); to make both visible.

Oh, and you also got the HTML wrong, class="display:none" is invalid.

The next time please submit the bug with a JSfiddle testcase like instructed in the red box.

Last edited 3 years ago by sindresorhus (previous) (diff)

comment:2 Changed 3 years ago by toff@…

I can't confirm that this works and have set up a jsFiddle test case as suggested:  http://jsfiddle.net/zhrgK/

The following works:

  1. Slide up p
  2. Slide up container
  3. Slide down p
  4. Slide down container

=> p are visible

The following does NOT work (Safari 5.1.7 on Mac):

  1. Slide up container
  2. Slide up p
  3. Slide down container

=> p is still visible though it was slider up when the container was up, too.

So in my opinion this is still an open bug.

comment:3 Changed 3 years ago by rwaldron

#11886 is a duplicate of this ticket.

Note: See TracTickets for help on using tickets.