Fix issue when parent has position: relative. offsetLeft is offset from the nearest relatively positioned parent, so a relative parent that has any sort of left offset will cause the mouse position to be wrong. This issue isn't noticeable in most cases because it's taking the difference between the time you start dragging at and the current time under the mouse, and most timelines are linear. It does cause issues with non-linear timelines though, such as when some periods are hidden.
Fix issue when parent has
position: relative
.offsetLeft
is offset from the nearest relatively positioned parent, so a relative parent that has any sort of left offset will cause the mouse position to be wrong. This issue isn't noticeable in most cases because it's taking the difference between the time you start dragging at and the current time under the mouse, and most timelines are linear. It does cause issues with non-linear timelines though, such as when some periods are hidden.JSFiddle
Examples
Old code with left margin
Fixed code with left margin
Old code with scroll
Fixed code with scroll
![fixed-scroll](https://user-images.githubusercontent.com/7794502/47166537-07bb3d80-d2c2-11e8-899d-fa70a40c397c.gif)