Ticket #11821 (closed bug: worksforme)
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 13 months 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
comment:2 Changed 13 months 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:
- Slide up p
- Slide up container
- Slide down p
- Slide down container
=> p are visible
The following does NOT work (Safari 5.1.7 on Mac):
- Slide up container
- Slide up p
- 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.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

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.