WebPublisher/JavaScript & jQuery

[javaScript] 페이지를 따라다니는 하단 띠 배너

amanda 2024. 11. 8. 09:17
let prevScrollpose = window.pageYOffset;
		
	window.addEventListener("scroll", function() {
		let currentScrollPose = window.pageYOffset;
		if (prevScrollpose > currentScrollPose) {
			document.getElementById("bnr_btm").style.bottom = "60px"; // 스크롤 올릴 때
		} else {
			document.getElementById("bnr_btm").style.bottom = "0px"; // 스크롤 내릴 때
		}
		prevScrollpose = currentScrollPose;
	});
}