Just add a 'push' class to bring the container down, and remove it when the menu is collapsed.
if (menu.is(":visible"))
{
menu.slideUp(400, function() {
$(this).removeClass("open");
$('.container').removeClass("push");
});
}
else
{
menu.slideDown(400, function() {
$(this).addClass("open");
$('.container').addClass("push");
});
}
.push {
bottom: -150px !important;
}
Not the best approach. But I hope it does the job for you.
Here is the Fiddle link. Hope it helps.
Update
You could try adding jquery animation to make it look smoother.
if (menu.is(":visible"))
{
menu.slideUp(400, function() {
$(this).removeClass("open");
$( ".container" ).animate({
bottom: "+=50",
}, 1000, function() {
// Animation complete.
});
});
}
else
{
menu.slideDown(400, function() {
$(this).addClass("open");
$( ".container" ).animate({
bottom: "-=50",
}, 1000, function() {
// Animation complete.
});
});
}
Here is the fiddle
Another approach would be to dynamically add a div between the container and the menu using jquery, set it a height and slide it down when the menu is open, and collapse it when the menu is closed. You would effectively do this in the callback part of your existing slideDown function.
Hope this helps.