Mouse position not working anymore

Discussion in 'Javascript' started by romain.larmet@gmail.com, Jun 15, 2007.

  1. Guest

    Hi all,

    I need to get the mouse cursor's position using JavaScript. Until now,
    everything was working well in IE, FF and Opera using the
    event.clientX/Y and e.pageX/Y members, depending on which browser is
    used.
    However, I've made some modifications (I don't remember what precisely
    but nothing related to this component, in fact) and now this portion
    of JavaScript code isn't working anymore.
    Now, the cursor's position are still "undefined", even if the
    mousemove handler is indeed executed. The strange thing is that this
    behaviour occurs in all 3 browsers, which means that not only
    event.clientX/Y returns undefined, but also e.pageX/Y for Firefox...
    Any idea on why these coordinates are not available anymore?

    Thanks
     
    , Jun 15, 2007
    #1
    1. Advertising

  2. RobG Guest

    On Jun 15, 6:34 pm, wrote:
    > Hi all,
    >
    > I need to get the mouse cursor's position using JavaScript. Until now,
    > everything was working well in IE, FF and Opera using the
    > event.clientX/Y and e.pageX/Y members, depending on which browser is
    > used.
    > However, I've made some modifications (I don't remember what precisely
    > but nothing related to this component, in fact) and now this portion
    > of JavaScript code isn't working anymore.
    > Now, the cursor's position are still "undefined", even if the
    > mousemove handler is indeed executed. The strange thing is that this
    > behaviour occurs in all 3 browsers, which means that not only
    > event.clientX/Y returns undefined, but also e.pageX/Y for Firefox...
    > Any idea on why these coordinates are not available anymore?


    Perhaps you have a script error? :)

    Seriously, it is a bit much to expect anyone to debug a script they
    can't see based on a very general description of the situation: "I had
    a function that worked, I made some changes that I can't remember and
    now it's broken - what could be wrong?".

    Go back to a version of your script file that works and apply your new
    changes one by one. Alternatively, create a test case that shows the
    error using *only* the positioning function. Remove as much as you
    can from the script file that keeps the error.

    Your error is in the remaining bit (I hope it's small). You will
    likely find the error before you get this far.


    --
    Rob
     
    RobG, Jun 15, 2007
    #2
    1. Advertising

  3. Guest

    Hi Rob,

    Thank you for your relpy. I know my description was vague, but I can't
    give you code, since the same function being executed in another page
    works perfectly.
    Of course there isn't any JavaScript error (at least, not that the 3
    browsers complain about). It's just that mouse coordinates are always
    undefined.
    Even a simple mousemove handler like "window.status = event.clientX;"
    will show "undefined" in the status bar.
    Now, of course on my side I'm trying to get back changeset by
    changeset to find out what caused the problem to appear, but meanwhile
    I was just trying to know if there is a known behaviour which causes
    the mouse coordinates to become unavailable?

    Thanks,

    On 15 juin, 10:48, RobG <> wrote:
    > On Jun 15, 6:34 pm, wrote:
    >
    > > Hi all,

    >
    > > I need to get the mouse cursor's position using JavaScript. Until now,
    > > everything was working well in IE, FF and Opera using the
    > > event.clientX/Y and e.pageX/Y members, depending on which browser is
    > > used.
    > > However, I've made some modifications (I don't remember what precisely
    > > but nothing related to this component, in fact) and now this portion
    > > of JavaScript code isn't working anymore.
    > > Now, the cursor's position are still "undefined", even if the
    > > mousemove handler is indeed executed. The strange thing is that this
    > > behaviour occurs in all 3 browsers, which means that not only
    > > event.clientX/Y returns undefined, but also e.pageX/Y for Firefox...
    > > Any idea on why these coordinates are not available anymore?

    >
    > Perhaps you have a script error? :)
    >
    > Seriously, it is a bit much to expect anyone to debug a script they
    > can't see based on a very general description of the situation: "I had
    > a function that worked, I made some changes that I can't remember and
    > now it's broken - what could be wrong?".
    >
    > Go back to a version of your script file that works and apply your new
    > changes one by one. Alternatively, create a test case that shows the
    > error using *only* the positioning function. Remove as much as you
    > can from the script file that keeps the error.
    >
    > Your error is in the remaining bit (I hope it's small). You will
    > likely find the error before you get this far.
    >
    > --
    > Rob
     
    , Jun 15, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tersia Ehlert

    HTTPS - Window. code not working anymore

    Tersia Ehlert, Jan 10, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    466
    =?Utf-8?B?QnJhZCBSb2JlcnRz?=
    Jan 10, 2005
  2. Max
    Replies:
    7
    Views:
    9,157
  3. tom arnall
    Replies:
    6
    Views:
    1,293
    Ian Shef
    Jan 18, 2007
  4. Eric Lilja
    Replies:
    4
    Views:
    495
  5. James Black
    Replies:
    0
    Views:
    407
    James Black
    May 28, 2006
Loading...

Share This Page