I have a structure like this:

As you can see, I have a fixed nav-bar at the top of the page and a drop down sidebar. Then I have a <div> element with content id.
Inside this <div> element I have some content, and finally, I have a <div> with a fixed position to the bottom of the page.
What I want is to hide the bottom div when the user scrolls down to the bottom of the page.
I have tried this but it doesn't work as I expected:
$('div#content').scroll(function () {
var fixedBottom = $("#dialog-button-bar");
if ($('div#content').height() <= ($(window).height() + $(window).scrollTop())) {
fixedBottom.css("opacity", 0 );
} else {
fixedBottom.css("opacity", 1 );
}
});
I hope to someone can help me. Thanks