Skip to content

Commit

Permalink
Merge pull request #17 from Azbury/top
Browse files Browse the repository at this point in the history
Use top instead of offsetTop
  • Loading branch information
mrtrimble authored Feb 29, 2024
2 parents fd34b2c + 30fec61 commit 80afb8d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/handhold.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,10 @@ export default class Handhold {
const boundingBox = document.querySelector('.handhold-bounding-box');
boundingBox.innerHTML = '';
const dimensions = this.getElementDimension(this._currentStepElement);
const currentStepPos = this._currentStepElement.offsetTop;
boundingBox.style = [
`--hh-boundingbox-height: ${dimensions.height}px`,
`--hh-boundingbox-width: ${dimensions.width}px`,
`--hh-boundingbox-top: ${currentStepPos}px`,
`--hh-boundingbox-top: ${dimensions.top}px`,
`--hh-boundingbox-left: ${dimensions.left}px`,
].join(';');

Expand Down

0 comments on commit 80afb8d

Please sign in to comment.