better position sensing for scroll directive