Skip to content

Commit

Permalink
Accurately do the bounds for <hr>s
Browse files Browse the repository at this point in the history
  • Loading branch information
mduvall committed Sep 24, 2013
1 parent 66267a9 commit d79953b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions js/grande.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,10 @@
// Compute top and bottom bounds for each child element
for (i = 0, len = childrenNodes.length - 1; i < len; i++) {
preNode = childrenNodes[i];
postNode = childrenNodes[i] || null;
postNode = childrenNodes[i+1] || null;

bottomBound = preNode.getBoundingClientRect().bottom - 20;
topBound = postNode.getBoundingClientRect().top + 20;
bottomBound = preNode.getBoundingClientRect().bottom - 5;
topBound = postNode.getBoundingClientRect().top;

bounds.push({
top: topBound,
Expand All @@ -158,7 +158,7 @@
bound = bounds[i];
if (coordY < bound.top && coordY > bound.bottom) {
imageTooltip.style.left = (boundsTarget.left - 90 ) + "px";
imageTooltip.style.top = (bound.top - 20) + "px";
imageTooltip.style.top = (bound.top - 17) + "px";
return;
}
}
Expand Down

0 comments on commit d79953b

Please sign in to comment.