JS to detect scrolled refresh