When the web page is too long so that scrollbar shows up, $(document).width() will show different result between Chrome/FF and IE.
Chrome/FF will get the width without scrollbar's width, but IE will take the scrollbar as one part of document.
If we want to calculate the absolute position of any element, it may be helpful.
Chrome/FF will get the width without scrollbar's width, but IE will take the scrollbar as one part of document.
If we want to calculate the absolute position of any element, it may be helpful.
本文探讨了在不同浏览器(如Chrome、Firefox与IE)中获取网页宽度时存在的差异。特别是当页面过长出现滚动条时,Chrome和Firefox计算的文档宽度不包含滚动条宽度,而IE则将滚动条视为文档的一部分。这对于计算元素绝对位置具有一定帮助。
11万+

被折叠的 条评论
为什么被折叠?



