Source:
public void show() { GQuery tooltip = getTip(); String title = getTitle(); if (!enabled || (title == null && options.getWidget() == null) || (title != null && title.length() == 0)) { return; } tooltip.detach() .removeClass(style.in(), style.top(), style.bottom(), style.left(), style.right()) .css("top", "0") .css("left", "0") .css("display", "block"); String container = options.getContainer(); if (container == null || "parent".equals(container)) { tooltip.insertAfter($element); } else if ("element".equals(container)) { tooltip.appendTo($element); } else { tooltip.appendTo($(container)); } setContent(title); OffsetInfo oi = OffsetInfo.from($element); long actualWidth = tooltip.get(0).getOffsetWidth(); long actualHeight = tooltip.get(0).getOffsetHeight(); long finalTop = -1; long finalLeft = -1; String placementClass = null; switch (getPlacement()) { case BOTTOM: finalTop = oi.top + oi.height; finalLeft = oi.left + oi.width / 2 - actualWidth / 2; placementClass = style.bottom(); break; case TOP: finalTop = oi.top - actualHeight; finalLeft = oi.left + oi.width / 2 - actualWidth / 2; placementClass = style.top(); break; case LEFT: finalTop = oi.top + oi.height / 2 - actualHeight / 2; finalLeft = oi.left - actualWidth; placementClass = style.left(); break; case RIGHT: finalTop = oi.top + oi.height / 2 - actualHeight / 2; finalLeft = oi.left + oi.width; placementClass = style.right(); break; } Offset additionalOffset = getAdditionalOffset(); if (additionalOffset != null) { finalTop += additionalOffset.top; finalLeft += additionalOffset.left; } tooltip.offset((int) finalTop, (int) finalLeft); tooltip.addClass(placementClass) .addClass(style.in()); }

Target:
public void show() { GQuery tooltip = getTip(); if (!enabled || noContentInTooltip()) { return; } tooltip.detach() .removeClass(style.in(), style.top(), style.bottom(), style.left(), style.right()) .css("top", "0") .css("left", "0") .css("display", "block"); String container = options.getContainer(); if (container == null || "parent".equals(container)) { tooltip.insertAfter($element); } else if ("element".equals(container)) { tooltip.appendTo($element); } else { tooltip.appendTo($(container)); } setContent(); OffsetInfo oi = OffsetInfo.from($element); long actualWidth = tooltip.get(0).getOffsetWidth(); long actualHeight = tooltip.get(0).getOffsetHeight(); long finalTop = -1; long finalLeft = -1; String placementClass = null; switch (getPlacement()) { case BOTTOM: finalTop = oi.top + oi.height; finalLeft = oi.left + oi.width / 2 - actualWidth / 2; placementClass = style.bottom(); break; case TOP: finalTop = oi.top - actualHeight; finalLeft = oi.left + oi.width / 2 - actualWidth / 2; placementClass = style.top(); break; case LEFT: finalTop = oi.top + oi.height / 2 - actualHeight / 2; finalLeft = oi.left - actualWidth; placementClass = style.left(); break; case RIGHT: finalTop = oi.top + oi.height / 2 - actualHeight / 2; finalLeft = oi.left + oi.width; placementClass = style.right(); break; } Offset additionalOffset = getAdditionalOffset(); if (additionalOffset != null) { finalTop += additionalOffset.top; finalLeft += additionalOffset.left; } tooltip.offset((int) finalTop, (int) finalLeft); tooltip.addClass(placementClass) .addClass(style.in()); }