SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Sep 2008
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Script that updates specific content every 24 hrs

    Hi,
    I'm looking for a script that will allow automatic updates of content every so often.

    For example, I have a box that contains four images, image1.jpg, image2.jpg, image3.jpg and image4.jpg.

    I want image1.jpg to be displayed on Monday. Then by midnight I want to swap automatically to image2.jpg and so on.

    I need a script that will work with either images, links or small amounts of text.

    Can anyone help me out?

    Thanks!

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,189
    Mentioned
    191 Post(s)
    Tagged
    2 Thread(s)
    Hi ipetronella, welcome to the forums.
    You can use javascript's Date object to getDay(), then use a switch case to change the images src attribute value. To change text, modifying the DOM, although a bit trickier than simply changing a src value, would be the best way to do it.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •