Advertisement
Guest User

Untitled

a guest
Apr 18th, 2015
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. jQuery(document).ready(function() {
  2.     var t = new Date(),
  3.         h = t.getHours(),
  4.         m = t.getMinutes(),
  5.         background = document.getElementById("ipbwrapper");
  6.     if (h >= 22 || h >= 0 && h < 6) {
  7.         if (m >= 30) {
  8.             background.className += "night";
  9.         } else {
  10.             background.className += "night1";
  11.         }
  12.     } else if (h >= 6 && h < 9) {
  13.         if (m >= 30) {
  14.             background.className += "dawn";
  15.         } else {
  16.             background.className += "dawn1";
  17.         }
  18.     } else if (h >= 9 && h < 20) {
  19.         if (m >= 30) {
  20.             background.className += "day";
  21.         } else {
  22.             background.className += "day1";
  23.         }
  24.     } else {
  25.         if (m >= 40) {
  26.             background.className += "dusk";
  27.         } else if (m >= 20) {
  28.             background.className += "dusk1";
  29.         } else {
  30.             background.className += "dusk2";
  31.         }
  32.     }
  33. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement