- using cached scrollTop value if possible
 - fallback to attachEvent for older IE versions