Hi, any recommendations on switching a background say, start w/the sun and if a user returns to the homepage it will be dark w/the moon?
(Not necessarily using flash)
any suggestions would be greatly appreciated!
Hi, any recommendations on switching a background say, start w/the sun and if a user returns to the homepage it will be dark w/the moon?
(Not necessarily using flash)
any suggestions would be greatly appreciated!
Done that. I use PHP but you can use JS.
Use the date object to get the hour (use the 24 hour version). Then use an if statement for checking whether it is between times of night (using <= => <>), or day.
edit:/ Oh you didn’t want to switch at day and night, just user return. Set a cookie upon visit as to what background they used (sun to start). Then upon return have it check whether the cookie exists and that the referer wasn’t a page of your site. If the cookie exists, change the value of the cookie, and make the background night. If it doesn’t, create it, and make it day.
cool thanks. I’m not familiar w/using cookies but I’ll check it out.
:: Copyright KIRUPA 2024 //--