SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    Posts rarely lloydi's Avatar
    Join Date
    Jan 2002
    Location
    Swindon UK
    Posts
    620
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Mouse movement detect

    I need a little help with a timer function. It needs to be possible to reset the timer if:

    * mouse movement is detected
    * any key is pressed

    I have experimented with onMouseMove attached to the BODY tag, but it constantly triggered the action required (an alert, for the initial purposes of testing) - I got into a loop and could never get out!

    Has anyone used anything like this before? And if so, could you help?

    Mille grazie
    Build Your Own Web Site the Right Way!
    A beginners' HTML/CSS book with web standards at its heart
    The Ultimate HTML Reference
    A complete reference, in glorious hardback

  2. #2
    SitePoint Guru siphilp's Avatar
    Join Date
    Nov 2001
    Location
    Fife, Scotland
    Posts
    663
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you were using .NET then this would be easy to implement. Never say a script that does what your talking about. I will put my feelers out and let you know what i get


    Si

  3. #3
    What? Maelstrom's Avatar
    Join Date
    Oct 2001
    Location
    Whistler BC originally from Guelph Ontario
    Posts
    2,175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You are looking at some advanced event handling techniques and yes javascript should be able to pull that off. (without .net)

    http://www.webreference.com/js/column74/

    Well they used to have around 5 of them and they covered every detail. Hmmm...

    http://www.webreference.com/js/column18/
    http://www.webreference.com/js/column19/

    Those may help. Event handling in javascript is excellent but once again the cross browser aspect makes it an irratating concept.
    Maelstrom Personal - Apparition Visions
    Development - PhP || Mysql || Zend || Devshed
    Unix - FreeBSD || FreeBsdForums || Man Pages
    They made me a sitepoint Mentor - Feel free to PM me or Email me and I will see if I can help.

  4. #4
    SitePoint Addict
    Join Date
    Sep 2000
    Posts
    230
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here's something from Dan Steinman' DHTML API about capturing the mouse x/y position.

    Don't know if it would be possible to grab the x and y and then if that changes do what you need to do?

    http://www.dansteinman.com/dynduo/en/mouseevents.html


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
  •