Search code examples
jqueryhideslidedownslideup

What is the difference between JQuery's hide() and slideDown()/slideUp()?


It seems like after calling both result is the same.


Solution

  • The show/hide methods animates width, height and opacity, while slideUp/sideDown only animates the height.

    The default duration of show/hide is zero, so if you don't specify a duartion it will show/hide the element immediately.

    If you are not seeing any difference between the methods, then they are most likely not working propery with the element that you apply them to. A common reason for that is that you are testing in Internet Explorer, and the element doesn't have the layout flag. If you for example try to animate a table cell, the style changes that the animation does on the element won't apply, and you will just see that the element is shown/hidden.