Jquery SlideUp Height

height, jquery, slideup

Solution

 $('#arrow').click(function () {
      if ($('#slide1').hasClass("small")) {
         $('#slide1').animate({"height": "40px"}, "medium").removeClass("small"); 
      } else {

            $('#slide1').animate({"height": "20px"}, "medium").addClass("small");
      }
  });

You can use the `animate` method to change the `height`. And `hasClass` method to check the condition of the div(is it in the original size or not). Here I have added a class 'small' to indicate the reduced height state.

click here for the jsfiddle

Problem

``` $(document).ready(function() { $('#arrow').click(function () { if ($('#slide1').is(":hidden")) { $('#slide1').slideDown('medium'); } else { $('#slide1').slideUp('normal'); } }); }); ``` how can I mention the slideup height alone?

Original source