스마트폰 하단 태스크 바(task bar)에 따른 하단 bottom 자동으로 제어하기
마스터욱
0
52
0
0
2025-08-31 22:06:39
function updateFooterPadding()
{
const footer = document.querySelector(".task-bar-bottom");
if(window.visualViewport){
const diff = window.innerHeight - window.visualViewport.height;
footer.style.paddingBottom = diff > 0 ? diff + "px" : "48px"; // 최소 10px
}
}
window.visualViewport.addEventListener("resize", updateFooterPadding);
window.addEventListener("resize", updateFooterPadding);
updateFooterPadding();








