본문 바로가기

Story/Javascript

document.body.scrollHeight -> document.documentElement.scrollHeight

반응형

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
// max = document.body.scrollHeight - itm.scrollHeight - min;
//document.documentElement.scrollTop
max = document.documentElement.scrollHeight - itm.scrollHeight - min;
tmp = document.documentElement.scrollTop + min;

2===================
<!--<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">-->


max = document.body.scrollHeight - itm.scrollHeight - min;
document.documentElement.scrollTop


ei,ff 스크롤 높이를 구하려고 고생함

floatingMenu.maxHeight = (document.all)? document.body.scrollHeight:document.documentElement.scrollHeight;
반응형