Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function viewPostStage2(link, postNumber, post) {
- post.onmouseout = function(event) {
- var next = post;
- while (!!next) {
- var list = traverseChildren(next);
- var e = event.toElement || event.relatedTarget;
- if (list.indexOf(e) >= 0)
- return;
- next = next.nextPostPreview;
- }
- post.style.display = "none";
- if (post.previousPostPreview)
- post.previousPostPreview.onmouseout(event);
- };
- post.onmouseover = function(event) {
- post.mustHide = false;
- };
- post.style.position = "absolute";
- var doc = document.documentElement;
- var linkCenter = link.left + (link.right - link.left) / 2;
- if (linkCenter < 0.6 * doc.clientWidth) {
- post.style.maxWidth = doc.clientWidth - linkCenter + "px";
- post.style.left = linkCenter + "px";
- } else {
- post.style.maxWidth = linkCenter + "px";
- post.style.left = linkCenter - post.scrollWidth + "px";
- }
- post.style.top = (doc.clientHeight - link.bottom >= post.scrollHeight)
- ? (doc.scrollTop + link.bottom - 4 + "px")
- : (doc.scrollTop + link.top - post.scrollHeight - 4 + "px");
- post.style.zIndex = 9999;
- /*var offs = cumulativeOffset(link);
- post.style.left = (offs.left + link.offsetWidth + 20) + "px";
- post.style.top = (offs.top - 40) + "px";*/
- if (!postPreviews[postNumber])
- postPreviews[postNumber] = post;
- else
- post.style.display = "";
- post.previousPostPreview = lastPostPreview;
- if (!!lastPostPreview)
- lastPostPreview.nextPostPreview = post;
- lastPostPreview = post;
- post.mustHide = true;
- if (!!lastPostPreviewTimer)
- clearTimeout(lastPostPreviewTimer);
- document.body.appendChild(post);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement