Answer the question
In order to leave comments, you need to log in
What needs to be fixed so that the tooltip does not jump every time?
Hello! There is a hint, there is js for this hint, which, as planned, should: tooltip.getBoundingClientRect().left < 0, the 'm-left' class is added to the plate. Now the class is added, and then removed, and so on. What value do I need to remember in the if (posLeft < 0) condition?
And another question, what do I need to compare window.innerWidth with to determine that this plate does not go beyond the right border of the screen? Now, for example, I set posLeft + tooltip.clientWidth + 26, it seems to work, but not always, what calculation should be there? Please help me figure it out.
Link to example
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question