Idea:
When the mouse is dragged: the sum of 1 and 3 remains unchanged. Subtract sum from the coordinates of the mouse to get 2
2 is the relative left margin left of the dragged element
When the mouse is pressed: you can get 2 and the current coordinates of the mouse to calculate sum(1+3)