changed get offset function to work with elements inside another scroll element