|
Post by Wormopolis on Aug 3, 2010 3:01:47 GMT -8
Browser Tested: IE and FF placement: global footer
makes a pagedrop appear below a user's display name that has a link to their recent posts.
code:
<script type="text/javascript"> <!-- // Silkworm code // User recent posts on name using pagedrop // v1.0 // by Wormopolis - wormocodes.proboards.com // do not repost - keep header intact
if (!location.href.match(/userdrop/)) {
var tm_usr, tm_usr2=false; var curleft = curtop = 0;
function newplace() { pageSpan.style.cssText = "position: absolute; top: "+ (curtop+12) +"px; left: "+curleft+"px;"; pageSpan.style.display=''; }
function load_tlist_pageSpan2(obj) { window.clearTimeout(tm_usr2); pageSpan = document.getElementById('pagedropmenu'); usrname=obj.storename; if (obj.offsetParent) { curleft = obj.offsetLeft; curtop = obj.offsetTop; while (obj = obj.offsetParent) { curleft += obj.offsetLeft; curtop += obj.offsetTop; } }
pageSpan.innerHTML="<a href=/index.cgi?action=userrecentposts&user="+usrname+">Last 10 posts</a>"; pageSpan.onmouseover=function() {window.clearTimeout(tm_usr2); showPageSpan()};
if (pageSpan.keepit && pageSpan.keepit!=obj) pageSpan.style.display='none'; pageSpan.keepit=obj;
tm_usr=window.setTimeout("newplace()",1000); }
function unload_tlist_pageSpan2() { tm_usr2=window.setTimeout("pageSpan.style.display='none';", 3000); }
for (lnks=document.getElementsByTagName('a'), i=0; i<lnks.length; i++) { if (lnks[i].href.match(/action=viewprofile&user=(.*?)$/)) { keep=RegExp.$1; lnks[i].storename=keep; lnks[i].onmouseover=function() {load_tlist_pageSpan2(this);} lnks[i].onmouseout=function() {window.clearTimeout(tm_usr); unload_tlist_pageSpan2();};
} }
} // --> </script>
preview: using it on this site
|
|