Open dandv opened 9 years ago
:+1:
I agree that tether should handle the flipping of the offset values when the tethered object flips.
Current solution is to avoid using tether offset and use CSS instead.
// LESSCSS
@element-offset: 10px;
.element {
&.tether-target-attached-top {
&.tether-element-attached-bottom {
margin-top: -@element-offset;
}
}
&.tether-target-attached-bottom {
&.tether-element-attached-top {
margin-top: @element-offset;
}
}
}
A possible solution without breaking current implementations would be to add relativeOffset
and absoluteOffset
:+1:
:+1:
Its also possible to update the Tether offset on the fly and reposition manually. Checking the classes you can now where is positioned, top or bottom, and set the offset as negative or positive accordingly.
A more efficient way would be appreacited, though. Wondering why there is no interest in mantaining this project.
@woble CSS solution: problem is here that tether triggers the flip wrong and the element is cropped before it flips.
CSS might be good, but I have no idea how to handle case when we have percentage value like this: targetOffset: '50% 0'
In this configuration, what should happen to the offset if the tether is flipped?
Here's a CodePen demonstrating the issue. I would expect the vertical offset to flip as well, but instead it remains constant:
Flipping the offset would be useful if the offset is used to allow for an arrow - the arrow will be flipped, and it needs the space provided by the offset: