Wiki fading out
Posted: Sat Apr 02, 2011 6:27 am
When I view the wiki, it gradually fades away. This is due to a bit of javascript which I've attached for posterity. Now April 1st has gone, can it be removed?
Code: Select all
<script>
function fade() {
var c = readCookie('thw_fade41');
if(c == null){
c = 1;
}
if (c > .005 ){
for (i = c; i >= 0; i -= .005) {
setTimeout("setOpacity(" + i + ")", (c-i) * 150000);
}
}
}
function setOpacity(level) {
document.body.style.opacity = level;
document.body.style.MozOpacity = level;
document.body.style.KhtmlOpacity = level;
document.body.style.filter = "alpha(opacity=" + (level * 100) + ");";
createCookie('thw_fade41',level,1.5);
}
function createCookie(name,value,hours) {
if (hours) {
var date = new Date();
date.setTime(date.getTime()+(hours*60*60*1000));
var expires = "; expires="+date.toGMTString();
}
else var expires = "";
document.cookie = name+"="+value+expires+"; path=/";
}
function readCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1,c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
}
return null;
}
function eraseCookie(name) {
createCookie(name,"",-1);
}
fade();