ialex
New Member
Posts: 10
inherit
143112
0
May 29, 2010 13:09:41 GMT -8
ialex
10
July 2009
ialex
|
Post by ialex on Aug 16, 2007 15:08:46 GMT -8
This code will allow each user to expand/collapse the news fader. It will also remember your choice.
Cross Browser.
Main Footer.
<script type="text/javascript"> <!--
/*Expand/Collapse News Fader - By iAlex - Open Source*/
if(location.href.match(/action=home/) || !location.href.match(/action/) && !document.postForm && !document.modifyForm){ var iTd=document.getElementsByTagName('td'); var i=iTd.length; while(--i){ if(iTd.item(i).className=="newstitlebg" && iTd.item(i).align=="center" && iTd.item(i).innerHTML.match(/>News</)){ var iNewSpan=document.createElement('span'); iNewSpan.innerHTML='<font color="'+iTd.item(i).firstChild.color+'"><b> - <font size="1">(Expand/Collapse)</font></b></font>'; iNewSpan.style.cursor='pointer'; iNewSpan.onclick=function(){iNewsCollapse(this);}; iTd.item(i).appendChild(iNewSpan); (document.cookie.match(/iNews=iCollapsed/))? iNewsCollapse(iNewSpan) : ''; break; } } } function iNewsCollapse(iSpan){ var iTr=iSpan.parentNode.parentNode.nextSibling; (iTr.style.display=="none")? document.cookie='iNews=iCollapsed;expires=Sat, 20 Jan 1990 12:12:12 UTC; path=/;' : document.cookie='iNews=iCollapsed;expires=Sat, 20 Jan 2050 12:12:12 UTC; path=/;'; (iTr.style.display=="none")? iTr.style.display='' : iTr.style.display='none'; }
//--> </script>
|
|