diff --git a/notebook/static/notebook/js/tooltip.js b/notebook/static/notebook/js/tooltip.js index d131200d8..ba93a1d9c 100644 --- a/notebook/static/notebook/js/tooltip.js +++ b/notebook/static/notebook/js/tooltip.js @@ -274,6 +274,7 @@ define([ // do some math to have the tooltip arrow on more or less on left or right // position of the editor var cm_pos = $(this.code_mirror.getWrapperElement()).position(); + var cell_pos = $(this.code_mirror.getWrapperElement().offsetParent).position(); // anchor and head positions are local within CodeMirror element var anchor = this.code_mirror.cursorCoords(false, 'local'); @@ -286,8 +287,8 @@ define([ var arrow_left = center_left - edge_left - 24; // locate left, top within container element - var left = (cm_pos.left + edge_left) + 'px'; - var top = (cm_pos.top + head.bottom + 10) + 'px'; + var left = (cell_pos.left + cm_pos.left + edge_left) + 'px'; + var top = (cell_pos.top + cm_pos.top + head.bottom + 10) + 'px'; if (this._hidden === false) { this.tooltip.animate({