View Full Version : image help...
RICHe
24-12-2006, 03:47 PM
HI :]
anyone know how to make an image change at different times of the day
like morning
evening
night time??
thanks ♥
alarmclock
24-12-2006, 03:51 PM
There is a Javascript code for this, i'll try and find it for you :)
RICHe
27-12-2006, 05:53 PM
ohhh thanks :]
Agnostic Bear
27-12-2006, 06:17 PM
I think this should work (not tryed it)
<?php
$time = gmdate("H");
if($time < "5")
{ echo("image"); }
elseif($time < "10")
{ echo("different image"); }
else
{ echo ("image before whatever lol"); }
?>
Just add more
elseif($time < "num")
{ echo("image"); }
num should be the hour in 24 hour time format (I think!)
omgDAN!
27-12-2006, 06:34 PM
Try this:
http://www.javascriptkit.com/javatutors/time2.shtml
Invent
27-12-2006, 07:20 PM
Dan's code is probably alot smaller and is easier to edit (:
Want to hide these adverts? Register an account for free!
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.