ScrollWidth: Content Beyond the box, width is the width of the content, not beyond the box itself width+padding
ScrollHeight: Content beyond the box, height for the content of the high. No more than the box itself height+padding
Note: Ie67,scrollheight Even if the box is not exceeded, its value is also the height of the content
<!DOCTYPE HTML><HTMLLang= "en"><Head> <MetaCharSet= "UTF-8"> <title>Title</title></Head><Body><Divstyle= "width:100px;height:100px;border:1px solid #000;"> <Divstyle= "width:120px;height:400px;border:1px solid #ccc;"></Div></Div><Script> varDivele=document.getElementsByTagName ("Div")[0]; Console.log (divele.scrollwidth);//122Console.log (divele.scrollheight);//402</Script></Body></HTML>
ScrollLeft: The length of the left content to be rolled away by the browser
ScrollTop: The length of the head content that is curled by the browser
Note: Generally through window.onscroll monitoring, their use has serious compatibility issues, Google's judgment is based on the body, and IE is judged by the entire HTML
<Script>Window.onscroll=function () { varXleft=Window.pagexoffset||Document.documentElement.scrollLeft||Document.body.scrollLeft; varytop=Window.pageyoffset||Document.documentElement.scrollTop||Document.body.scrollTop; Document.title=Xleft+" "+ytop; }</Script>
Js--scroll