bharatraj88/angular2-tooltip

Choosing tooltip position

Opened this issue · 2 comments

Hello,

is there a way to choose where the tooltip is positioned ?

I'd like it to be above the mouse.

Thank you very much.

Also, the position of tooltip is continuously getting changed.

in the tooltip.component.ts file just add window.scrollY inside the options object for y property
let options:ContentOptions = {
content : this.content,
cls : this.ngToolTipClass,
x : event.clientX,
y: event.clientY + window.scrollY,
offset : this.tooltipDisplayOffset
};

this will position the tooltip based on the cursor even if you scroll the page.