ded / bonzo

library agnostic, extensible DOM utility
Other
1.32k stars 137 forks source link

Why `scrollWidth` and `offsetWidth`? #109

Closed krmgns closed 11 years ago

krmgns commented 11 years ago

If I'm wrong, please correct;

If looking for document height, then seems something wrong width this line (cos it gives same result with width).

https://github.com/ded/bonzo/blob/master/bonzo.js#L858

Test: var dims = bonzo(document).dim(); console.log(dims.width, "x", dims.height) Output: 1263x1263

Math.max(el.body.scrollHeight, el.body.offsetHeight, de.scrollWidth, de.offsetWidth, de.clientHeight)

And, I think it shold be like;

Math.max(el.body.scrollHeight, el.body.offsetHeight, de.scrollHeight, de.offsetHeight, de.clientHeight)

rvagg commented 11 years ago

ooops! my bad; nicely picked up. Fixed in 258deda8a5