[jQuery] animate two divs for a slide up effect
Hello,
I am trying to animate two divs for a sliding effect. The div
currently being shown in the window slides up as it should but the
following div just appears without the animation.
The code is:
$('#np_current').css('overflow', 'auto');
var curHeight = "-"+getHeight($('#np_current'));
$('#np_current').css('overflow', 'hidden');
$('#np_current').animate({'marginTop': curHeight}, 1000,
function() {$(this).hide()}).removeAttr('id').attr('id', 'remove');
$('#np_next').css('overflow', 'auto');
var nxtHeight = getHeight($('#np_next'));
$('#np_next').animate({'marginBottom':'nxtHeight'}, 1000,
function() {$(this).show()});
This can be seen here: www.truckingshow.com/test by clicking on the
'next' button. If you do not see a next button, try refreshing the
page until it appears (it only shows when there are 3 more entries).
I just cannot figure it out and any help is appreciated.
Thanks much - chris