var html = document.documentElement, body = document.body; var scrollTop = html && html.scrollTop || body && body.scrollTop || 0;