Post by Wormopolis on Jul 1, 2009 2:05:30 GMT -8
Browser Tested: IE and FF
placement: main footer
Uses the built in pagedrop function from ProBoards to display a list of sub-boards that will disappear after about 2 seconds if you move your mouse out of it.
code:
Preview: using it on main page of WormoCodes, but I dont have many sub-boards
EDIT: bug fix to keep "viewing" from ending up as the drop trigger
UPDATES TO THIS CODE FOUND ON wormocodes.proboards.com
placement: main footer
Uses the built in pagedrop function from ProBoards to display a list of sub-boards that will disappear after about 2 seconds if you move your mouse out of it.
code:
<style type="text/css">
.sbdd { text-decoration: underline}
</style>
<script type="text/javascript">
<!--
// sub-board drop down using pagespan functions from ProBoards
// v1.5
// by Wormopolis - [url]wormocodes.proboards.com[/url]
// do not repost - keep header intact
if (!location.href.match(/pagedrop/)) {
var moveDropToBottom=true; //move (sub-boards) to bottom of cell
var removePageSpan = "";
var pageSpan = document.getElementById('pagedropmenu');
function load_subboards_PageSpan(obj,stuff) {
pageSpan = document.getElementById('pagedropmenu');
var curleft = curtop = 0;
if (obj.offsetParent) {
curleft = obj.offsetLeft;
curtop = obj.offsetTop;
while (obj = obj.offsetParent) {
curleft += obj.offsetLeft;
curtop += obj.offsetTop;
}
}
pageSpan.innerHTML=stuff.innerHTML;
pageSpan.style.cssText = "position: absolute; top: "+ (curtop+12) +"px; left: "+curleft+"px; display: ;";
}
var fjumpList=document.getElementById('forumjump').options;
for (tds=document.getElementsByTagName('td'), i=0; i<tds.length; i++) {
if (tds[i].width=="66%" && tds[i].className.match(/windowbg/) && tds[i].align=="left" && tds[i].firstChild.innerHTML.match(/sub-board/)) {
bname=tds[i].getElementsByTagName('a')[0].href.split('board=')[1];
btitle=tds[i].getElementsByTagName('b')[0].innerHTML;
dest=tds[i].firstChild.firstChild.nextSibling;
if (dest.innerHTML.match(/viewing/i)) dest=dest.nextSibling;
dest_stuff=dest.innerHTML;
dest.innerHTML='<span onmouseover="load_subboards_PageSpan(this,this.nextSibling);window.clearTimeout(removePageSpan);" onmouseout="hidePageSpan(event,1);" style="cursor: pointer;" class="pagejump"><font class="sbdd">'+dest_stuff.replace('(','[').replace(')',']') +'</font></span>';
if (moveDropToBottom) { tds[i].appendChild(document.createElement('br')); tds[i].appendChild(dest); }
holdstuff=dest.appendChild(document.createElement('span'));
holdstuff.style.display="none";
rgxp=new RegExp("\\\/index.cgi\\\?board="+bname+"$","i");
for (j=0; j<fjumpList.length; j++) {
if (fjumpList[j].value.match(rgxp)) {
while (fjumpList[j+1] && fjumpList[j+1].innerHTML.match(/-{3}\s/)) {
holdstuff.innerHTML+="<a onmouseover='window.clearTimeout(removePageSpan);' href='"+ fjumpList[j+1].value +"'>"+ fjumpList[j+1].innerHTML.replace('--- ','') +"<br></a>";
j++;
}
break;
}
}
}
}
}
// -->
</script>
Preview: using it on main page of WormoCodes, but I dont have many sub-boards
EDIT: bug fix to keep "viewing" from ending up as the drop trigger
UPDATES TO THIS CODE FOUND ON wormocodes.proboards.com