$(function(){ (function () { function regPopupBlock() { window.scrollTo({ top: 100, // behavior: 'smooth', }) $("#mobile").focus() }; document.getElementById('bottomBtn').addEventListener('click', regPopupBlock, false) window.addEventListener('scroll', function () { window.requestAnimationFrame(function () { if (window.scrollY > 500) { document.getElementById('bottom-btn-bar').style.display = 'block'; } else { document.getElementById('bottom-btn-bar').style.display = 'none'; } }) }) })() })