document.getElementById("show-st").addEventListener("click", function(ev) { ev.preventDefault(); showStickyBar(); }); function hideStickyBar(){ var stickyiframeholder = document.getElementById("stickyiframeholder"); stickyiframeholder.classList.add('hidden'); var placeholderdivid = document.getElementById("placeholderdivid"); if(placeholderdivid) placeholderdivid.classList.add('hidden'); var stickyWrapper = document.getElementById("stickyWrapper"); stickyWrapper.classList.remove('hidden'); /* Fires event when sticky bar is hidden */ var hideEvent = new CustomEvent('lpStickyHide',{ bubbles:true, cancelable: true, detail: { "stickyiframeholder":stickyiframeholder, "placeholderdivid":placeholderdivid, "stickywrapper":stickyWrapper } }); window.dispatchEvent(hideEvent); } function showStickyBar(){ var stickyiframeholder = document.getElementById("stickyiframeholder"); stickyiframeholder.classList.remove('hidden'); var placeholderdivid = document.getElementById("placeholderdivid"); if(placeholderdivid) placeholderdivid.classList.remove('hidden'); var stickyWrapper = document.getElementById("stickyWrapper"); stickyWrapper.classList.add('hidden'); /* Fires event when sticky bar is shown */ var showEvent = new CustomEvent('lpStickyShow',{ bubbles:true, cancelable: true, detail: { "stickyiframeholder":stickyiframeholder, "placeholderdivid":placeholderdivid, "stickywrapper":stickyWrapper } }); window.dispatchEvent(showEvent); }