Update scroll function for element