My webpage layout consists of a fixed nav-bar
at the top, a drop down sidebar, a <div>
element with an id of content
, some content inside the <div>
, and a bottom <div>
with a fixed position.
I am trying to hide the bottom <div>
when the user scrolls to the bottom of the page. I attempted to achieve this using the following code:
$('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 );
}
});
If anyone has a solution to help me achieve this, I would greatly appreciate it. Thank you.