Updates the scroll and resize events