If you bored with your same layout. You might try this code. It will change ur layout everyday.
Put this codes at the top of your main Js. This will change your css every day dpending on viewer's computer time setting.
[spoiler][quote]//auto css switch everyday by bagusxfantasy
var d=new Date();
theDay=d.getDay();
switch (theDay)
{
case 0:
var css = document.createElement("link");
css.type = "text/css";
css.rel = "stylesheet";
css.href = "[b]url css no1[/b]";
css.media = "screen, print";
document.getElementsByTagName("head")[0].appendChild(css);
break;
case 1:
break;
var css = document.createElement("link");
css.type = "text/css";
css.rel = "stylesheet";
css.href = "[b]url css no 2[/b]";
css.media = "screen, print";
document.getElementsByTagName("head")[0].appendChild(css);
case 2:
var css = document.createElement("link");
css.type = "text/css";
css.rel = "stylesheet";
css.href = "[b]url css no3[/b]";
css.media = "screen, print";
document.getElementsByTagName("head")[0].appendChild(css);
break;
case 3:
var css = document.createElement("link");
css.type = "text/css";
css.rel = "stylesheet";
css.href = "[b]url css no 4[/b]";
css.media = "screen, print";
document.getElementsByTagName("head")[0].appendChild(css);
break;
case 4:
var css = document.createElement("link");
css.type = "text/css";
css.rel = "stylesheet";
css.href = "[b]url css no 5[/b]";
css.media = "screen, print";
document.getElementsByTagName("head")[0].appendChild(css);
break;
case 5:
var css = document.createElement("link");
css.type = "text/css";
css.rel = "stylesheet";
css.href = "[b]url css no 6[/b]";
css.media = "screen, print";
document.getElementsByTagName("head")[0].appendChild(css);
break;
default:
var css = document.createElement("link");
css.type = "text/css";
css.rel = "stylesheet";
css.href = "[b]url css no 7[/b]";
css.media = "screen, print";
document.getElementsByTagName("head")[0].appendChild(css);
}[/quote]
[/spoiler]
Edit the bold part.
Note: Case 0 is sunday, case 1 is monday, case 2 is tuesday, and so on.
[url=http://profiles.friendster.com/91341104][b]Test here[/b][/url]
Change your computer time setting to another day to see the effect than view the test profile.
If you want different Js everyday just change this part.
[quote][b]var css = document.createElement("link");
css.type = "text/css";
css.rel = "stylesheet";
css.href = "url css";
css.media = "screen, print";
document.getElementsByTagName("head")[0].appendChild(css);[/b][/quote]
with this
[quote][b]var myjs = document.createElement("script");
myjs.type = "text/javascript";
myjs.src = "url js";
document.getElementsByTagName("head")[0].appendChild(myjs);[/b][/quote]
Enjoy tweaking
Last edited by bagusxfantasy (2008-12-12 10:55:14)