问答详情
源自:9-19 网页尺寸scrollHeight

网页尺寸问题

搞不懂第二个  var h,为什么显示为8,scrollHeight到底代表的什么?

提问者:默默竹 2016-09-01 09:05

个回答

  • joyboy0405
    2016-09-01 09:29:42

    不懂啊,感觉这部分的讲解有些粗略,我刚试了下,你在前面加一些document.write的输出,h的值会变大,取得具体是什么高度我也不是很清楚。还有就是document.body.scrollheight和document.documentElement.scrollheight分开写,不写成兼容模式的时候只有document.documentElement.scrollheight输出的值会变化。