Peter
New Member
God
Posts: 6
|
Post by Peter on Oct 30, 2004 13:17:39 GMT
Code by ?snap2000
Adds a gap in between posts. Click For Example
You can control the background color for the divider, or add an image. <script><!-- /* Seperate posts by snap2000 */ TD = document.getElementsByTagName('TD'); var gapHeight="10"; //Height of gap between posts var gapBg=document.bgColor; //Leave unless needed var gapImg=new Array("","center"); //Image Seperator(optional),align if (location.href.match("action=display")) { if(gapImg[0] != "") { gapImg[0]='<img src="'+gapImg[0]+'">'; } for(d=0;d<TD.length;d++) { if (TD[d].width=="20%" && (TD[d].innerText.match("Posts: ") || TD[d].innerText.match("guest"))){ who=TD[d].getElementsByTagName('a')[0].innerText+' ('+TD[d].getElementsByTagName('a')[0].outerHTML.split("username=")[1].split("\"")[0]+')'; gapHTML='<div style="background-color:'+gapBg+';padding:'+parseInt(gapHeight/4)+' 0 '+parseInt(gapHeight/4)+' 0;align:'+gapImg[1]+'">'+gapImg[0]+'</div>' TD[d-2].innerHTML = gapHTML+TD[d-2].innerHTML+gapHTML; }}} //--></script>
Sorry to be so vague. M Hendricks posted the methods to change the background color, and specifically to add an image. If you have any questions, just ask. The changes below have been made since release: -Gap method was altered slightly in attempt to fix a problem with the gap always appearing the same. -Error fixed related to guests' posts was fixed.
|
|