SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru johnjohn2's Avatar
    Join Date
    Apr 2004
    Location
    here
    Posts
    746
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    screen saver type layer?

    I have an unusual request. My client wants a screen saver, but not a real "windows" screen saver. He just wants a scrolling message like the (windows text marquee screensaver) whenever the user has not been active on a page for 20 minutes. Then when they are active on the site again he wants to be able to just remove the message and continue back to where they were. Is there some sort of count down to 20 minutes before a scrolling text layer would appear? Maybe similar to the popups on this site?

  2. #2
    I meant that to happen silver trophybronze trophy Raffles's Avatar
    Join Date
    Sep 2005
    Location
    Tanzania
    Posts
    4,662
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    You would need to use window.setTimeout() for this, and set the second argument to 1200000 (1.2 million milliseconds). The first argument would be a function that displays this "screensaver".

    You would also have to add something to trigger the end of the timer, the onmousemove event and onkeypress events are probably best (you would most likely need to use them both). With each of these events, you do window.clearTimeout() and then do a new window.setTimeout() to start it all over again, so that the 20 minutes begin when the user stops moving their mouse or typing.

    No offense to your client, but it seems like a rather stupid request.


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
  •