WIP extract scrollTop js in a function