Development/Javascript, jQuery
[javascript] 고정 레이어 스크립트 처리
kunoo
2017. 6. 16. 09:49
마우스 스크롤시 일정 이상 내려갔을 때 레이어의 style속성 변경 처리
$(function(){
$(window).scroll(
function(){
if($(window).scrollTop() <= 210)
{
document.getElementById("id명").style.position = "absolute";
document.getElementById("id명").style.top = "240px";
}else{
document.getElementById("id명").style.position = "fixed";
document.getElementById("id명").style.top = "150px";
}
});
}
);