Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show animations, like $.show() $.toggle() and $.slideDown(), don't respect css display property if initial state is display:none; #1774

mgol opened this issue Oct 21, 2014 · 4 comments


Copy link

@mgol mgol commented Oct 21, 2014

Originally reported by nicholasbg at:

When an element that has a class with a css display property that is not its default (for example a <span> with "display:block"), and has an inline style (like "display:none"), setting it to be displayed with something like $.toggle(200) will cause it to not use the class's display property, while $.toggle() will work properly. Even $.toggle(0) will exhibit this behaviour.

From what I can tell this bug was introduced in 1.11.0/2.1.0

This jsFiddle will demonstrate the bug...

You can see it working normally if you change the jQuery version to something before 1.11.0/2.1.0 or remove the 200 from .toggle(200).

This is a very similar case to...

Ticket #14824

Issue reported for jQuery 1.11.1


This comment has been minimized.

Copy link
Member Author

@mgol mgol commented Oct 21, 2014

Comment author: dmethvin

We have entirely too much magic up in here.

@mgol mgol added the Bug label Oct 21, 2014

This comment has been minimized.

Copy link

@robertmaxrees robertmaxrees commented Dec 12, 2014

Updating to jQuery 1.11.1 shows that this is no longer a bug:

Also changing to current Edge shows that the bug hasn't returned, as well:

We might want to close this out accordingly.

@dmethvin dmethvin removed the Bug label Dec 12, 2014

This comment has been minimized.

Copy link

@dmethvin dmethvin commented Dec 12, 2014

OK then, closing this ticket. Thanks @robertmaxrees !


This comment has been minimized.

Copy link

@nicholasbg nicholasbg commented Jul 14, 2015

Sorry for coming late but this bug was not fixed on any 1.x or 2.x version of jQuery. As stated in the bug report, you need to make the inline style display none and to add a duration to see the bug in action.

Here is a fork of robertmaxrees 1.11.1 fiddle with the bug (with the above changes) still happening.

The bug is fixed in the edge (currently v3.0.0-pre) and edge compat version though.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
4 participants
You can’t perform that action at this time.