可惜仅有IE(IE5)很早就支持,chrome DOM就不支持这个方法。除了top left right bottom这几个属性,firefox还增加了width和height属性。
console.log(document.body.getBoundingClientRect());
console.log(document.body.getBoundingClientRect());