I’ve attached a full-width form to the footer of the page, using a very helpful snippet I found from someone here (below). I would like the sticky section to hide itself once it reaches the bottom of the page. How can I do this?
//Fixed Menu (Header or footer) v1.3.1
//Replace ID below with your own box ID
var boxToAppend = '#lp-pom-box-243';
//Set to 'header' or 'footer'
var headerOrFooter = 'footer';
var backgroundCSS = {"position":"fixed", "left":"0", "top":"0px", "bottom":"auto", "width":"100%", "z-index":"899"};
var colorOverlayCSS = {"position":"fixed", "left":"0", "top":"0px", "bottom":"auto", "width":"100%", "z-index":"auto", "border-style":"none none none none"};
var childrenCSS = {"position":"fixed", "left":"auto", "top":"0px", "bottom":"auto", "width":"100%", "z-index":"999", "border-style":"none none none none", "border-width":"0px", "background":"none"};
if (headerOrFooter === 'footer') {
backgroundCSSS"top"] = 'auto';
backgroundCSSS"bottom"] = '0px';
colorOverlayCSSS"top"] = 'auto';
colorOverlayCSSS"bottom"] = '0px';
childrenCSSS"top"] = 'auto';
childrenCSSS"bottom"] = '0px';
}
var boxParent = $(boxToAppend).parent();
var boxClone = $(boxToAppend).clone()
boxClone.appendTo(boxParent).css(backgroundCSS).children().remove();
$(boxToAppend).css(childrenCSS);
$(boxToAppend + '-color-overlay').appendTo(boxClone).css(colorOverlayCSS);