Fix for issue #1205 toElementEdge

Function now considers the current scroll position while attempting to
compute the elements relative position.