T
T
timtimIT2015-10-24 18:31:34
JavaScript
timtimIT, 2015-10-24 18:31:34

How to animate block expansion using jquery?

Hello.

There is a code:

$(".button-read_more").click( function(event){
  event.preventDefault();
    if ( $(this).hasClass("isDown") ) {	
    $("div.b-room-full-info").stop().animate({"height":0},"slow");	
    
    } else {
     $("div.b-room-full-info").stop().animate({"height":"auto"},"slow");	
     }
    $(this).toggleClass("isDown");
  return false;
});


but it doesn't work, how to specify height auto correctly?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaly Inchin ☢, 2015-10-24
@timtimIT

$(".button-read_more").click(function(e){
  e.preventDefault();
  $("div.b-room-full-info").slideToggle("slow");	
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question