Detect idle scroll state for sliding header or footer in appropriate direction