Skip to content

Commit

Permalink
Add scrolling position #18
Browse files Browse the repository at this point in the history
  • Loading branch information
sroertgen committed Feb 15, 2024
1 parent 8211c96 commit 4d435b1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions public/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,12 @@
// Position the tooltip above the button or wherever you prefer
tooltip.style.left = btnRect.left + (btnRect.width / 2) - (tooltipWidth / 2) + "px";
tooltip.style.top = btnRect.top - tooltipHeight - 15 + "px"; // Adjust "5" for margin between button and tooltip
tooltip.style.top = btnRect.top + window.scrollY - 15 + "px"; // Adjust "5" for margin between button and tooltip
// Show the tooltip
tooltip.style.display = "block";
// Hide the tooltip after a few seconds or on another button click
// Hide the tooltip after a few seconds
setTimeout(function() {
tooltip.style.display = "none";
document.body.removeChild(tooltip); // Clean up by removing the tooltip from the DOM
Expand Down

0 comments on commit 4d435b1

Please sign in to comment.