CodePudding user response:
Elements must be set CSS position: relative/absolute/fixed; After the left and top to workAdditionally the offsetLeft is the current element with recent position of elements of the relative/absolute/fixed parents for distance, have no direct relationship with the CSS left,