The JS-function for positioning tooltips is based on absolute positioning relative to the HTML-document. It should instead be based on the relative size of the viewport and the relative positioning of the mouse pointer to the viewport with fixed positioning in the CSS. This will allow for better positioning of tooltips for the user. The following changes should be considered:
Replace scrollWidth/scrollHeight with clientWidth/clientHeight
Replace pageX/pageY with clientX/clientY
Change positioning from absolute to fixed on wrapper elements for tooltips
The JS-function for positioning tooltips is based on absolute positioning relative to the HTML-document. It should instead be based on the relative size of the viewport and the relative positioning of the mouse pointer to the viewport with fixed positioning in the CSS. This will allow for better positioning of tooltips for the user. The following changes should be considered:
scrollWidth
/scrollHeight
withclientWidth
/clientHeight
pageX
/pageY
withclientX
/clientY
absolute
tofixed
on wrapper elements for tooltips