|
Post by Wormopolis on Mar 8, 2010 1:54:21 GMT -8
Browser Tested: IE and FF placement: main footer
Turns an entry in the main forum table for a board into a free standing image. It will resume the table after the image for the rest of the boards.
code:
<script type="text/javascript"> <!-- // convert board to floating image // by Wormopolis - www.wormocodes.com // keep header intact
boardArray=new Array();
boardArray['general']="http://www.pollsb.com/photos/o/59924-next_monster.jpg"; // add in your replacement images here. boardid in the brackets.
// DO NOT EDIT BELOW for (tb=document.getElementsByTagName('table'), b=0; b<tb.length; b++) { if (tb[b].className=='bordercolor' && tb[b].cellSpacing==0 && tb[b].cellPadding==0 && tb[b].width=='100%') { keeptable=tb[b].parentNode.cloneNode(true); break; } }
document.write('<textarea id="helper" style="display:none">temp</textarea>');
hlpr=document.getElementById('helper'); for (tds=keeptable.getElementsByTagName('td'), d=tds.length-1; d>=0; d--) { if (tds[d].width=='66%' && tds[d].className.match(/windowbg/) && tds[d].vAlign=='top') { if (tds[d].getElementsByTagName('a')[0].href.match(/board=(.*?)$/)) { bname=RegExp.$1; if(boardArray[bname]) { keepLink=tds[d].getElementsByTagName('a')[0].href; keepcount=tds[d].parentNode.getElementsByTagName('td')-1; temp='</tbody></table></td></tr></table><br>'; temp+='<center><a href="'+keepLink+'"><img src="'+boardArray[bname]+'" border=0></a></center>'; temp+='<table border="0" width="100%" cellspacing="0" cellpadding="0" class="bordercolor"><tr><td><table cellpadding="4" cellspacing="1" border="0" width="100%">'; hold=tds[d].parentNode.parentNode.parentNode; hold=hold.parentNode.parentNode.parentNode; hold=hold.parentNode.parentNode; hlpr.value=hold.innerHTML; hlpr.value=hlpr.value.replace(/(\n|\r|\v)/gm,''); hlpr.value=hlpr.value.replace('<tr>'+tds[d].parentNode.innerHTML+'</tr>',temp); hlpr.value=hlpr.value.replace('<TR>'+tds[d].parentNode.innerHTML.replace(/(\n|\r|\v)/gm,'')+'</TR>',temp); hold.innerHTML=hlpr.value; } } } } tb[b].parentNode.parentNode.replaceChild(keeptable,tb[b].parentNode); hlpr.parentNode.removeChild(hlpr);
// --> </script>
Preview: I will have to cook one up. stay tuned.
|
|
|
Post by randie on Mar 16, 2010 9:58:17 GMT -8
This is actually a nice code!
|
|
|
Post by Wormopolis on Mar 16, 2010 11:25:47 GMT -8
afte re-doing the request 5 times... I would hope so.
I thought about submitting some of the first versions as well..
|
|
|
Post by randie on Mar 16, 2010 11:43:26 GMT -8
afte re-doing the request 5 times... I would hope so. I thought about submitting some of the first versions as well.. Why not submit them or at least post a link to that thread. Yeah, I kept checking that request until you got it right! ;D I cropped 10 images for 10 boards. I'll send you link via pm.
|
|
|
Post by Wormopolis on Mar 16, 2010 13:28:14 GMT -8
I got the link. replied via PM.
|
|
|
Post by Wormopolis on Apr 6, 2010 1:29:42 GMT -8
|
|
chriskarate
Not New Member
Posts: 3
chriskarate said 0 great things
|
Post by chriskarate on May 31, 2010 9:59:30 GMT -8
Are you still making that example?
|
|
|
Post by Wormopolis on May 31, 2010 11:44:04 GMT -8
apparently now I am...
|
|