Advertisement
Guest User

Untitled

a guest
Feb 24th, 2015
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     post.style.position = "absolute";
  2.     var doc = document.documentElement;
  3.     var linkCenter = link.left + (link.right - link.left) / 2;
  4.     if (linkCenter < 0.6 * doc.clientWidth) {
  5.         post.style.maxWidth = doc.clientWidth - linkCenter + "px";
  6.         post.style.left = linkCenter + "px";
  7.     } else {
  8.         post.style.maxWidth = linkCenter + "px";
  9.         post.style.left = linkCenter - post.scrollWidth + "px";
  10.     }
  11.     post.style.top = (doc.clientHeight - link.bottom >= post.scrollHeight)
  12.         ? (doc.scrollTop + link.bottom - 4 + "px")
  13.         : (doc.scrollTop + link.top - post.scrollHeight - 4 + "px");
  14.     post.style.zIndex = 9999;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement