So I’m wanting my element to start out as 50px in height and then on click go to height:“auto”. I’ve read that I can’t do the auto, so i’ve set a variable that gets the height of the element. BUT, i’m having issues getting the variable to work in the .animate() function.
Am I doing something wrong or can .animate not handle variables at all?
$('div.job_description').css("height","50px");
$("h3.job_title").toggle(function () {
var box_height = $(this).next().height();
$(this).next().animate({height:box_height},{queue:false,duration:500});
},
function () {
$(this).next().animate({height:"50px"},{queue:false,duration:500});
});