I’m using animate function, and I need to set the height property of the animation to match variable pituus, because the content height depends on form submit.
$.ajax({
type: "POST",
url: "http://www.kotisivut.name/quiz.php",
data: dataString,
dataType: "text",
error: function() {
alert('Nyt jotakin meni kyllä pahemman kerran pieleen. Yritä uudelleen?');
},
success: function(data) {
$("#resultcontainer").html(data);
$("#service-test").fadeOut(1400);
$("#resultcontainer").fadeIn(1500, function() {
alert($("#page").height());
var pituus = $("#page").height();
$("#page").animate({
"height": "pituus"
}, 1600);
});
}
});
However, it seems like I can’t pass a variable there?
You don’t need quotes, change to: