SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Evangelist
    Join Date
    Jun 2004
    Location
    ny
    Posts
    560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Refresh Pg if no movement

    I need to f5 a page only if there is no movement on a page/application in every 2 mins. Any idea?

  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)
    What exactly do you mean by "movement"? Moving the mouse? It is possible to interact with a webpage without moving the mouse, so you need to be more specific.

  3. #3
    SitePoint Evangelist
    Join Date
    Jun 2004
    Location
    ny
    Posts
    560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yes moving the mouse...

  4. #4
    SitePoint Addict
    Join Date
    Apr 2007
    Posts
    300
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    capture and store the mouse coordinates every two minutes and compare the value with the one stored previously. If there is a change update window.location.

  5. #5
    SitePoint Evangelist
    Join Date
    Jun 2004
    Location
    ny
    Posts
    560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I need a sample... pls submit one...

  6. #6
    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)
    Do some research of your own. We're not going to do all your work for you.

    In any case, you don't need the mouse coordinates. All you need is the onmousemove event on the document element.

  7. #7
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,702
    Mentioned
    101 Post(s)
    Tagged
    4 Thread(s)
    There is a lot of crap out there regarding programming javascript.

    Do you have any good sources from which he can work out what to do?
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  8. #8
    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)
    I'm being a bit dismissive because of the way the help is being asked for. Anyway...

    https://developer.mozilla.org/En/DOM/window.onmousemove
    https://developer.mozilla.org/En/DOM/window.setTimeout
    https://developer.mozilla.org/en/DOM...w.clearTimeout

    As far as I can tell, those are the only three things needed. By reading the documentation for them, emmim44, you can understand what they are for and how they work. Then you should be able to work out how to put them together to achieve what you want to do. If not, that's what this forum is here for. The important thing is that you put in some effort and give it a try.

  9. #9
    SitePoint Evangelist
    Join Date
    Jun 2004
    Location
    ny
    Posts
    560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The first example doesnt work on ie8... weird...


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
  •