Fix help position after scroll
This commit is contained in:
parent
1088cc5dca
commit
2b78d06646
|
@ -584,8 +584,9 @@ function helpMouseover(el, event, text, side) {
|
||||||
jush.highlight_tag([ help ]);
|
jush.highlight_tag([ help ]);
|
||||||
alterClass(help, 'hidden');
|
alterClass(help, 'hidden');
|
||||||
var rect = target.getBoundingClientRect();
|
var rect = target.getBoundingClientRect();
|
||||||
help.style.top = (rect.top - (side ? (help.offsetHeight - target.offsetHeight) / 2 : help.offsetHeight)) + 'px';
|
var body = document.documentElement;
|
||||||
help.style.left = (rect.left - (side ? help.offsetWidth : (help.offsetWidth - target.offsetWidth) / 2)) + 'px';
|
help.style.top = (body.scrollTop + rect.top - (side ? (help.offsetHeight - target.offsetHeight) / 2 : help.offsetHeight)) + 'px';
|
||||||
|
help.style.left = (body.scrollLeft + rect.left - (side ? help.offsetWidth : (help.offsetWidth - target.offsetWidth) / 2)) + 'px';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue