Use scrollHeight instead of offsetHeight