Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Display different content at different times of the day

Featured Replies

What I need help with is I want to display different content at different times of the day, without having to do it manually myself ever other hour.

 

So lets say for example i wanted to show 'Good Morning' at 8AM and 'Good Night' at 8PM, and for this to happen automatically. Does anyone know how to do this?

 

Or point me to any websites/tutorials/advice/examples that may help?

 

Thanks

I know of a css switcher that changes depending on the time of day. You could then set a background image for your "Good morning", "Good afternoon", etc...

 

With regards to it changing your actual HTML I'm guessing you'd need some form of JavaScript that printed a different message to screen depending on what time of day it is.

 

Try amending the following to fit: http://www.askdavetaylor.com/can_i_change_my_web_page_based_on_time_of_day.html

 

Or http://www.w3schools.com/js/js_if_else.asp

  • Author

yer thanks for that, if else is probably a good option to be honest. I was thinking of having several different responses stored somewhere and somehow using coding recall them from a database or something but im not quite sure.

  • Author

thanks for your help. no im not looking for someone to write the code. im just doing a bit of practising before i partake on my ZEND qualification im doing in april

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.