I have been trying to resolve an issue with a sticky element at the bottom of a page using javascript/jquery. However, the sticky element is hiding the body text. I want to display all body text without it being hidden by the sticky element, but I can't seem to pinpoint the exact problem in my code. Can someone please provide suggestions on what may be causing this issue?
Check out the CodePen demo for reference
Javascript:
var link = $('#navbar');
var offset = link.offset();
var top = offset.top;
var left = offset.left;
var bottom = $(window).height() - top - link.height();
bottom = offset.top - bottom;
var right = $(window).width() - link.width();
right = offset.left - right;
CSS:
#navbar {
position: fixed;
bottom: 0;
width: 100%;
color: #fff;
min-height: 50px;
max-height: 150px;
overflow: hidden;
background-color: #333;
}