Update getOffset function based on jQuery.fn.offset