Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- jQuery(document).ready(function() {
- var t = new Date(),
- h = t.getHours(),
- m = t.getMinutes(),
- background = document.getElementById("ipbwrapper");
- if (h >= 22 || h >= 0 && h < 6) {
- if (m >= 30) {
- background.className += "night";
- } else {
- background.className += "night1";
- }
- } else if (h >= 6 && h < 9) {
- if (m >= 30) {
- background.className += "dawn";
- } else {
- background.className += "dawn1";
- }
- } else if (h >= 9 && h < 20) {
- if (m >= 30) {
- background.className += "day";
- } else {
- background.className += "day1";
- }
- } else {
- if (m >= 40) {
- background.className += "dusk";
- } else if (m >= 20) {
- background.className += "dusk1";
- } else {
- background.className += "dusk2";
- }
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement