SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Member
    Join Date
    Jan 2010
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Javascript (was PHP) Timer

    I'm working to set up a dynamic 'highlights' component.

    I have 4 divs, with different ids and want one to show up initially, then after 10 seconds, display the second one in the place of the first one, then after 10 more seconds display the third one in place of the second... and so forth and repeat.

    Can anyone help me figure this out using PHP?

    I'm trying to replicate the "Today's Highlights" display on the comcast.net homepage.

    Thanks in advance, I really appreciate the help.

  2. #2
    SitePoint Member
    Join Date
    May 2010
    Location
    LA
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    dellis, I think you cannot create this using PHP.

    Try to use Javascript instead. Maybe you are you looking for something like that:
    http://css-tricks.com/creating-a-sli...ontent-slider/

  3. #3
    SitePoint Zealot
    Join Date
    Feb 2010
    Posts
    97
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ehh, PHP is server side, remember everything that has something to do with displaying content is handled by JavaScript (client-side).

    I don't know enough JS yet for timers, but here is something that I use to display/hide blocks:
    document.getElementById(id).style.display = 'none'; = hide
    document.getElementById(id).style.display = 'block'; = show

    id = your block id variable

  4. #4
    Utopia, Inc. silver trophy
    ScallioXTX's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    9,081
    Mentioned
    153 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by jan1024188 View Post
    ehh, PHP is server side, remember everything that has something to do with displaying content is handled by JavaScript (client-side).
    Shouldn't that be: everything that has something to do with changing how content is displayed?

  5. #5
    SitePoint Zealot
    Join Date
    Feb 2010
    Posts
    97
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ScallioXTX View Post
    Shouldn't that be: everything that has something to do with changing how content is displayed?
    Sorry for my bad rhetorics, English is just not my native language. So yeah, JS is as far as I know used to handle DOM as well as verify fields, do asynced requests (xml/json/plain) and other stuff. Basically a glue between user interactions and site.

  6. #6
    Utopia, Inc. silver trophy
    ScallioXTX's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    9,081
    Mentioned
    153 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by jan1024188 View Post
    Sorry for my bad rhetorics, English is just not my native language. So yeah, JS is as far as I know used to handle DOM as well as verify fields, do asynced requests (xml/json/plain) and other stuff. Basically a glue between user interactions and site.
    Exactly! Just wanted to verify

  7. #7
    SitePoint Member
    Join Date
    Jan 2010
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    sbbtina, excellent suggestion. I was able to modify and implement your link perfectly.

    Thanks so much.


Tags for this Thread

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
  •