I have an element with a flexbox
div#myFlexbox{
display:flex;
}
after hide it and show it, it gets messed up.<
Since other answers did not account for the possibility that you might be using the duration
argument...
Short Answer: Use .hide for hiding the value and that shouldn't happen.
A little explanation:
The matched elements will be hidden immediately, with no animation. This is roughly equivalent to calling .css( "display", "none" ), except that the value of the display property is saved in jQuery's data cache so that display can later be restored to its initial value. If an element has a display value of flex and is hidden then shown, it will once again be displayed flex.
From documentation, Changed 'inline' to 'flex' to fit the contenxt!
So jQuery knows what you're hiding! If you've hidden it using .hide that is, And it knows how to show it again with the right display value.