Skip to content
This repository has been archived by the owner on Feb 17, 2021. It is now read-only.

Calculate arrow offset without border #326

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/js/hopscotch.js
Expand Up @@ -647,7 +647,7 @@ HopscotchBubble.prototype = {
else if (step.placement === 'top' || step.placement === 'bottom') {
arrowEl.style.top = '';
if (arrowOffset === 'center') {
arrowEl.style[arrowPos] = Math.floor((bubbleBoundingWidth / 2) - arrowEl.offsetWidth/2) + 'px';
arrowEl.style[arrowPos] = Math.floor((el.clientWidth / 2) - arrowEl.offsetWidth/2) + 'px';
}
else {
// Numeric pixel value
Expand All @@ -657,7 +657,7 @@ HopscotchBubble.prototype = {
else if (step.placement === 'left' || step.placement === 'right') {
arrowEl.style[arrowPos] = '';
if (arrowOffset === 'center') {
arrowEl.style.top = Math.floor((bubbleBoundingHeight / 2) - arrowEl.offsetHeight/2) + 'px';
arrowEl.style.top = Math.floor((el.clientHeight / 2) - arrowEl.offsetHeight/2) + 'px';
}
else {
// Numeric pixel value
Expand Down