Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Show animations, like $.show() $.toggle() and $.slideDown(), don't respect css display property if initial state is display:none; #1774
Originally reported by nicholasbg at: http://bugs.jquery.com/ticket/15159
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... http://jsfiddle.net/e8kpg/
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...
Issue reported for jQuery 1.11.1
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.