Last active
January 11, 2020 09:09
-
-
Save roachhd/7bfa522b3d9409fae2df to your computer and use it in GitHub Desktop.
script to set a different CSS sheet for each day of the week
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var dSS = { | |
names: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], | |
number: new Date().getDay(), | |
link: document.createElement('link') | |
} | |
dSS.link.rel = "stylesheet"; | |
dSS.link.type = "text/css"; | |
dSS.link.href = dSS.names[ dSS.number ] + ".css"; | |
document.getElementsByTagName('head')[0].appendChild( dSS.link ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
<!-- | |
dayNames = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]; | |
dayNumber = new Date().getDay(); | |
document.writeln('<link rel="stylesheet" type="text/css" href="' + dayNames[dayNumber] + '.css">'); | |
//--> | |
</script> | |
<noscript> | |
<link rel="stylesheet" type="text/css" href="default.css"> | |
</noscript> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
👏