Fix whenScrolled directive for non-webkit browsers

Webkit and non-Webkit engines disagree about whether the body or the documentElement scrolls. Sidestep this issue by using window.pageYOffset.