Post by Scorpian on Jul 17, 2006 15:50:56 GMT -8
Looking to split that news fader from the rest of your boards? That damn thing gets kind of annoying, doesn't it Well, fret not! Scorpian is here. Hooray! I've created 3 codes that split the news fader from the board. One of them is bound to float your boat.
Version 1 is the simplest. It just splits the damn thing.
Version 2 will not only split it, it will also add head/base images to it It puts a head image above the title bar, and a base image below the fader.
Version 3 is the most complicated. It splits the news fader from the boards and adds head/base images just like version 2, only this one will turn the news title bar into the head image.
All 3 of these codes are cross-browser. They've all been tested very well. They go in your main footers. The closer to the top, the faster it loads. Editing is pretty straight-forward. If you have any questions, just ask.
Version 1 is the simplest. It just splits the damn thing.
<script type='text/javascript'>
/* Serperate News Fader from Boards by Scorpian
Version 1 - Just split the damn thing
http://roddyinnov.proboards75.com */
/*=== Edit These ===*/
var splitHeight = 30; // How much space you want to split it by
/*=== Do Not Edit ===*/
var riTable = document.getElementsByTagName('table');
if(location.href.match(/action=home/i) || !location.href.match(/(action|board)=/i)){
for(x=0; x<riTable.length; x++){
if(riTable[x].cellSpacing == 1 && riTable[x].cellPadding == 4 && riTable[x].rows[0].cells[0].innerHTML.match(/News/i)){
riTable[x].parentNode.parentNode.parentNode.parentNode.style.backgroundColor = 'transparent';
var newHTML = "<table width='100%' cellspacing='1' cellpadding='4' border='0' class='bordercolor'>";
newHTML += riTable[x].innerHTML;
newHTML += "</table><div style='height:"+splitHeight+"px;'></div>";
var newsFader = riTable[x].parentNode;
newsFader.innerHTML = newsFader.innerHTML.replace(newsFader.innerHTML,newHTML);
}
}
}
</script>
Version 2 will not only split it, it will also add head/base images to it It puts a head image above the title bar, and a base image below the fader.
<script type='text/javascript'>
/* Serperate News Fader from Boards by Scorpian
Version 2 - Split w/ head/base images
http://roddyinnov.proboards75.com */
/*=== Edit These ===*/
var headImg = 'URL'; // URL of head image
var baseImg = 'URL'; // URL of base image
var splitHeight = 30; // How much space you want to split it by
/*=== Do Not Edit ===*/
var riTable = document.getElementsByTagName('table');
if(location.href.match(/action=home/i) || !location.href.match(/(action|board)=/i)){
for(x=0; x<riTable.length; x++){
if(riTable[x].cellSpacing == 1 && riTable[x].cellPadding == 4 && riTable[x].rows[0].cells[0].innerHTML.match(/News/i)){
riTable[x].parentNode.parentNode.parentNode.parentNode.style.backgroundColor = 'transparent';
var newHTML = "<img src='"+headImg+"' />";
newHTML += "<table width='100%' cellspacing='1' cellpadding='4' border='0' class='bordercolor'>";
newHTML += riTable[x].innerHTML;
newHTML += "</table><img src='"+baseImg+"' /><div style='height:"+splitHeight+"px;'></div>";
var newsFader = riTable[x].parentNode;
newsFader.innerHTML = newsFader.innerHTML.replace(newsFader.innerHTML,newHTML);
}
}
}
</script>
Version 3 is the most complicated. It splits the news fader from the boards and adds head/base images just like version 2, only this one will turn the news title bar into the head image.
<script type='text/javascript'>
/* Serperate News Fader from Boards by Scorpian
Version 3 - Split w/ head/base images and head = title bar
http://roddyinnov.proboards75.com */
/*=== Edit These ===*/
var headImg = 'URL'; // URL of head image
var headHeight = 25; // Height of head image
var baseImg = 'URL'; // URL of base image
var splitHeight = 30; // How much space you want to split it by
/*=== Do Not Edit ===*/
var riTable = document.getElementsByTagName('table');
if(location.href.match(/action=home/i) || !location.href.match(/(action|board)=/i)){
for(x=0; x<riTable.length; x++){
if(riTable[x].cellSpacing == 1 && riTable[x].cellPadding == 4 && riTable[x].rows[0].cells[0].innerHTML.match(/News/i)){
riTable[x].parentNode.parentNode.parentNode.parentNode.style.backgroundColor = 'transparent';
riTable[x].rows[0].style.display = 'none';
var padding = headHeight-21;
var newHeight = headHeight-padding;
var newHTML = "<div style='background-image:url("+headImg+"); height:"+newHeight+"; padding-top:"+padding+"px;' align='center'>";
newHTML += riTable[x].rows[0].cells[0].innerHTML;
newHTML += "</div><table width='100%' cellspacing='1' cellpadding='4' border='0' class='bordercolor'>";
newHTML += riTable[x].innerHTML;
newHTML += "</table><img src='"+baseImg+"' /><div style='height:"+splitHeight+"px;'></div>";
var newsFader = riTable[x].parentNode;
newsFader.innerHTML = newsFader.innerHTML.replace(newsFader.innerHTML,newHTML);
}
}
}
</script>
All 3 of these codes are cross-browser. They've all been tested very well. They go in your main footers. The closer to the top, the faster it loads. Editing is pretty straight-forward. If you have any questions, just ask.