為什么document.documentElement.offsetWidth 和document.body.offsetWidth;得到的結果會不一樣啊?
我用document.documentElement.offsetWidth 和用這個document.body.offsetWidth;得到了不一樣的結果?這是為什么???
我用document.documentElement.offsetWidth 和用這個document.body.offsetWidth;得到了不一樣的結果?這是為什么???
2014-11-30
舉報
2014-12-01
由于瀏覽器的兼容性問題,因此會有兩種寫法。前者是獲取整個頁面的寬度,后者是只獲取body的寬度