JS function, can be placed in a separate JS file can also be placed in the current page
Copy Code code as follows:
function Getcss ()
{
Datetoday = new Date ();
Timenow=datetoday.gettime ();
Datetoday.settime (TimeNow);
Thehour = Datetoday.gethours ();
if (thehour<12)
display = "1.css";
else if (thehour>12)
The name of the style sheet, or you can add the path
display = "1.css";
Else
display = "2.css";
(... Want to add more can be ... )
var css = ' < ';
css+= ' link rel= ' stylesheet ' href= ' +display+ ' \/';
css+= ' > ';
document.write (CSS);
}
HTML file to which the style sheet is applied
Copy Code code as follows:
<title> display different cue messages at different times </title>
<script type= "Text/javascript" src= "Dacss.js" ></script>
<body>
<script type= "Text/javascript" >
Window.onload=getcss ();
</script>
JS controls different time periods to display different CSS styles
</body>