Animating the div's height with animate() fails
I've got a problem with animate() that isn't animating the height attribute properly ... no idea why.
I've got a picture gallery with text description below the pictures. I reduced the div hight of the container that's containing the gallery (
#Gallerie) to hide the text area and showing only the pictues. Theres a button (
Resize_Gallery) to resize the div containter to full size and shrink it again. But the animation doesen't work like it should. Instad of a smooth vertical movement it partialy moves smooth than jumps to the destination position and then a bit lower. Well, I've got no clue why this happens. When I use slideToggle() the movement works fine. So whey is animate() so different?
$('#Resize_Gallery').toggle( function(evt) {
evt.preventDefault();
var $GalleyResize=$('#Gallerie');
var $ResizeButton = $('#Resize_Gallery');
$('#Gallerie').animate({ 'height': '100' }, 1500); $ResizeButton.text('Klein');
}, function(evt) { evt.preventDefault();
var $GalleyResize=$('#Gallerie');
var $ResizeButton = $('#Resize_Gallery');
$('#Gallerie').animate({ 'heigth': '242' }, 1500); $ResizeButton.text('Gross'); }
);