Hello! There is a hint that there is js for this prompt, which as planned should: If die is beyond the visible area of the screen, ie tooltip.getBoundingClientRect().left < 0, then the die is added to the class 'm-left'. Now the class is added and then removed, and so on. What value I need to zapominat in the condition if (posLeft < 0)?
And another question, what I need to compare the window.innerWidth to determine that the die is not beyond the right edge of the screen? Now for example I put posLeft + tooltip.clientWidth + 26 it seems to be working, but not always, which calculation should be there? Please help to understand.
Link to example