Down The Street
« Expand/Collapse Last Post Cell »

Welcome Guest. Please Login or Register.
Nov 24, 2009, 8:48am




Down The Street :: The Codeum :: Code Database :: Submit a Code :: Expand/Collapse Last Post Cell
   [Search This Thread][Send Topic To Friend] [Print]
 AuthorTopic: Expand/Collapse Last Post Cell (Read 213 times)
Admin Bot
Administrator
*****
member is offline

[avatar]


[homepage]

Joined: Mar 2007
Gender: Male
Posts: 362
Location: UK
Karma: 1
 Expand/Collapse Last Post Cell
« Thread Started on Apr 15, 2007, 6:21pm »

Preview: http://wlog.proboards80.com/index.cgi#


Quote:
<div id="hideButton" style="display: block; text-align: center;">
<a href=# onclick="hide(); setCookie('hide', 'yes');">
Hide Last Post Cell
</a></div><div id="showButton" style="display: none; text-align: center;">
<a href=# onclick="show(); setCookie('hide', 'no');" />
Show Last Post Cell
</a></div><script>
//Expand & Collapse Last Post Column
//Created by Wrighty

function setCookie(cookieName, setTo)
{
var ExpDate = new Date();
ExpDate.setTime(ExpDate.getTime() + (365 * 24 * 60 * 60 * 1000));
var myDomain = location.pathname.substring(0, location.pathname.lastIndexOf("/")) + "/";
document.cookie = cookieName + "=" + escape(setTo) + "; expires=" + ExpDate + "; path=" + myDomain;
}

// Returns the value of the cookie, or null if the cookie doesn't exist
function getCookie(cookieName)
{
name = (cookieName + '=');
var dc = document.cookie;
if (dc.length > 0)
{
begin = dc.indexOf(name);
if (begin != -1)
{
begin += name.length;
end = dc.indexOf(';', begin);
if (end == -1) {end = dc.length;}
return unescape(dc.substring(begin, end));
}
}
return null;
}


var TD = document.getElementsByTagName("TD")



function hide()
{
for(i=0;i<TD.length;i++){
if(TD[i].width == "1%" && TD[i+1].width == "1%")
{
TD[i+2].style.display="none";
}
}
document.getElementById("hideButton").style.display = "none";
document.getElementById("showButton").style.display = "block";
}

function show()
{
for(i=0;i<TD.length;i++){
if(TD[i].width == "1%" && TD[i+1].width == "1%")
{
TD[i+2].style.display="";
}
}
document.getElementById("hideButton").style.display = "block";
document.getElementById("showButton").style.display = "none";
}

if (getCookie("hide") == "yes")
{
hide();
}
// -->

</script>


EDIT: Parts in Red!
« Last Edit: Apr 15, 2007, 6:43pm by Admin Bot »Link to Post - Back to Top  IP: Logged

I am the Admin Bot - PM ScottCool if you need anything!
   [Search This Thread][Send Topic To Friend] [Print]

Click Here To Make This Board Ad-Free


This Board Hosted For FREE By ProBoards
Get Your Own Free Message Boards & Free Forums!