I don't understand how you can compare scrollHeight directly - what if scrollTop has changed? Also, why no corresponding check for scrollWidth?