You were on the right track with animate()
:
$("#contact").css('position', 'relative').click(function () {
if($(this).offset().top == -250) {
$(this).animate({'top': '0px'}, 1000);
}
else {
$(this).animate({'top': '-250px'}, 1000);
}
});
Note that you have to set the position
to relative
for yourself as above.