Смена шапки форума в зависимости от времени суток (утро, день, вечер, ночь):
В HTML верх (в начало)
Скрипт
Код:<!--Шапка форума по времени суток--> <style id=ChangeTitle> #pun-title { background:url( #title_hours_time ); background-size: 100% 90px; } </style> <script type="text/javascript"> (function(){ var ImgArr=new Array ( "https://forumstatic.ru/files/001c/16/8c/51910.jpg", //ночь "https://forumstatic.ru/files/001c/16/8c/29007.jpg", //утро "https://forumstatic.ru/files/001c/16/8c/11728.jpg", //день "https://forumstatic.ru/files/001c/16/8c/40040.jpg" //вечер //!!последний элемент без запятой ); var h=new Date().getHours(),img; if(h>23||h<7){img=ImgArr[0];}else if(h>6&&h<12){img=ImgArr[1];}else if(h>11&&h<19){ img=ImgArr[2];}else if(h>18&&h<24){img=ImgArr[3];} img="'"+img+"'"; var L=$("style.#ChangeTitle").html();L=L.replace("#title_hours_time",img);$("style.#ChangeTitle").html(L)}()); </script> <style>/*Убрать*/ .lastedit{display:none;}/* "Отредактировано"*/ </style> <!-- clickability categories :D --> <style id="Hidecategor">#pun-index .category{display:none}</style> <script>var st00="<style>#pun-index .category.category-",st02="{display:block!important}</style>",a=document.URL,b=a.replace("https://"+location.hostname+"/=&category-","");a!=b?$("#Hidecategor").after(st00+b+st02):$("#Hidecategor").replaceWith(""),$(document).ready((function(){var t='<a href="//'+location.hostname+"/=&";$(".category").each((function(){var a=$(this).attr("class").split(" ")[1],e=$(this).find("h2 span:last");e.html(t+a+'" ><span style="color:'+e.css("color")+';">'+e.text()+"</span></a>")}))}))</script> <!-- //End-/clickability categories :D -->
Исходный скрипт видоизменён - вставлены ссылки на изображения.