This example describes how JavaScript periodically changes skin styles every day. Share to everyone for your reference. The specific analysis is as follows:
This JS code to change the function of the skin by automatically changing the style sheet of the Web page call at different time every day.
?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
<script type= "Text/javascript" > <!--function Getstylesh EET () {var currenttime = new Date (). getHours (); if (0 <= currenttime&¤ttime < 5) {document.write ("<link rel = ' stylesheet ' href= ' night.css ' type= ' text/css ' > '); if (5 <= Currenttime&¤ttime <) {document.write ("<link rel= ' stylesheet ' href= ' morning.css ') type= ' text/c" SS ' > "); } if (one <= Currenttime&¤ttime <) {document.write ("<link rel= ' stylesheet" href= ' day.css ' ' type= ', ' text/css ') > "); } if (<= Currenttime&¤ttime <) {document.write ("<link rel= ' stylesheet ' href= ' evening.css ') ' type= '" text/" CSS ' > '); } if (<= currenttime&¤ttime <=) {document.write ("<link rel= ' stylesheet ' href= ' night.css ')" type= SS ' > "); } getstylesheet (); --> </script> <NOSCRIpt> <link href= "main.css" rel= "stylesheet" type= "Text/css" > </noscript> |
The
wants this article to help you with your JavaScript programming.