Skip to content

Commit

Permalink
Fixed tooltip when scroll
Browse files Browse the repository at this point in the history
  • Loading branch information
PaddiM8 committed Mar 14, 2019
1 parent b6647ce commit ea84442
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.IO;
using System.Reflection;
using System.Linq;
using System.Diagnostics;

class Program
{
Expand Down
4 changes: 2 additions & 2 deletions Resources/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ document.getElementById("glossbox").addEventListener('mouseover', function(evt)
tooltip.innerHTML = tooltipText;

var evtRect = evt.target.getBoundingClientRect();
var left = evtRect.left - tooltip.getBoundingClientRect().width / 4;
var top = evtRect.top + 38;
var left = evtRect.left + window.scrollX - tooltip.getBoundingClientRect().width / 4;
var top = evtRect.top + window.scrollY + 38;
var arrow = document.getElementById("tooltip-arrow");
var arrowHeight = 14;
var arrowWidth = 16;
Expand Down

0 comments on commit ea84442

Please sign in to comment.