Script modificare fundal dupa ore

Discutii despre tot ce nu se incadreaza in celelalte categorii.

Moderators: Moderatori ajutatori, Moderatori

Post Reply
User avatar
Happy?
Membru, skill +1
Membru, skill +1
Posts: 454
Joined: 05 Jan 2013, 10:56
Detinator Steam: Da
SteamID: happyro
Location: Florida
Has thanked: 12 times
Been thanked: 38 times
Contact:

03 Dec 2013, 12:25

Dupa cum spune si titlul, este un script care schimba valoarea fundalului in functie de ore, il puteti seta sa schimbe culoarea/imaginea fundalului la o anumita ora sau il puteti clasifica in doua perioade, noapte si zi.

Se aduga inainte de <body> intre <head> si </head>:

Code: Select all

<script type="text/javascript">
<!--

        var now = new Date();
        var hours = now.getHours();
        var psj=0;
		document.write('<style type="text/css">')
        //18-19 noaptea
        if (hours > 17 && hours < 20){
                document.write('body{background:orange; color:#FFFFFF;} a{color: yellow !important}')
        }

        //20-21 noaptea
        if (hours > 19 && hours < 22){
                document.write('body{background:orangered; color:#FFFFFF;} a{color: yellow !important}')
        }

        //22-4 noaptea
        if (hours > 21 || hours < 5){
                document.write('body{background:black; color:#FFFFFF;} a{color: yellow !important}')
        }

        //9-17 ziua
        if (hours > 8 && hours < 18){
                document.write('body{background:deepskyblue; color:#FFFFFF;} a{color: yellow !important}')
        }

        //7-8 ziua
        if (hours > 6 && hours < 9){
                document.write('body{background:skyblue; color:#FFFFFF;} a{color: yellow !important}')
        }

        //5-6 ziua
        if (hours > 4 && hours < 7){
                document.write('body{background:steelblue; color:#FFFFFF;} a{color: yellow !important}')
        }
		document.write('<\/style>')
        
//-->
</script>
Daca aveti intrebari nu ezitati sa ma intrebati.
Rapidserver
User avatar
faggoat
Membru eXtream
Membru eXtream
Posts: 2283
Joined: 10 May 2013, 10:50
Detinator Steam: Nu
SteamID: noonstake
Reputatie: Nume anterior: stefanbri
Fost membru Club eXtreamCS ( 2 luni, Castigator eXtreamMEME )
Has thanked: 37 times
Been thanked: 29 times

03 Dec 2013, 12:35

Frumos, multumim.
Image
"e inundatie in cartier si tu dormi mancamiai pl de roman"
User avatar
fan_haulin
Fost moderator
Fost moderator
Posts: 2583
Joined: 08 Jun 2010, 19:35
Detinator Steam: Da
Reputatie: Fost Moderator
Has thanked: 270 times
Been thanked: 103 times
Contact:

03 Dec 2013, 14:38

Foarte frumoasa ideea !:))
:eye_emoji: GameQ+ - PHP game server query library [github]
User avatar
GamingWorld
Membru eXtream
Membru eXtream
Posts: 2200
Joined: 08 Mar 2012, 00:18
Detinator Steam: Da
CS Status: PHP GOD
Detinator server CS: Da
SteamID: legend_xpc
Reputatie: Membru Club eXtreamCS (8 luni)
Location: Bucuresti
Has thanked: 23 times
Been thanked: 35 times
Contact:

04 Dec 2013, 10:02

Frumos, eu facusem unul cu schimbare automata background dupa fiecare refresh al pagini.. la ore nu m-am gandit..

Bravo, frumoasa idee !
Pentru a-l contacta pe userul GamingWorld poti trimite un PM accesand direct profilul meu .
De altfel puteti sa ma gasiti si pe ImageBlog & si ImageYoutube !!
User avatar
faggoat
Membru eXtream
Membru eXtream
Posts: 2283
Joined: 10 May 2013, 10:50
Detinator Steam: Nu
SteamID: noonstake
Reputatie: Nume anterior: stefanbri
Fost membru Club eXtreamCS ( 2 luni, Castigator eXtreamMEME )
Has thanked: 37 times
Been thanked: 29 times

04 Dec 2013, 10:11

GamingWorld wrote:Frumos, eu facusem unul cu schimbare automata background dupa fiecare refresh al pagini.. la ore nu m-am gandit..

Bravo, frumoasa idee !
Poti posta un link cu script-ul tau?
Image
"e inundatie in cartier si tu dormi mancamiai pl de roman"
Post Reply

Return to “Discutii generale”

  • Information