Universal positions of tooltips
Sorry, but one more question. I'm trying to make the tooltip contain an image and a lot of text - in short, the block has a fairly large width and height, but with the current tooltip coordinate calculation function, there are times when some of the content remains outside the screen. How to correctly recalculate the coordinates so that the tooltip always fits entirely? I did something like this, but this code works a little messy.
if (map.tooltip.selector.style.display === 'block') {
var left = event.pageX - 10 - map.tooltip.width() + 'px',
top = event.pageY - 10 - map.tooltip.height() + 'px';
if (event.pageY < map.tooltip.height()) {
top = 0;
}
if (event.pageX < map.tooltip.width()) {
left = 0;
}
if (left < 0) {
left = 0;
}
if (top < 0) {
top = 0;
}
_this.tooltip.css({
left: left,
top: top
});
}
Hey @Valentine13 very sorry for the late response but I've been busy for the past months.
It would be great if you provided a pen at https://codepen.io (or anything else) that repreduces the issue plus an image of the issue if possible, so I can help.
Since this issue hasn't seen any activity recently, I'm closing it.
Feel free to reopen if needed!