Loading ...
Sorry, an error occurred while loading the content.

Problem with Event.getPageX() and Event.getPageY in IE&

Expand Messages
  • Whitcraft, Jon
    I am working on my selector and I get this error when I use YAHOO.util.Event.getPageX and getPageY Line: 776 Char: 14 Error: pageX is null or not an object
    Message 1 of 1 , Aug 29, 2006
    • 0 Attachment

      I am working on my selector and I get this error when I use YAHOO.util.Event.getPageX and getPageY

       

      Line: 776

      Char: 14

      Error: ‘pageX’ is null or not an object

      Code: 0

      URL: http://<path here>

       

      But when I use this function it works just fine:

       

      function getMouseX(e) {

        // mouseX including window scroll offset (excluding Safari, which appears to include this natively)

        e = e?e:event;

        mouseX = e.clientX+(!isSafari?((document.documentElement.scrollLeft||window.scrollX||document.body.scrollLeft)||0):0);

        return mouseX;

      }

       

      Why does the Event object use pageX but the function use clientX.  I though client x was the proper one to use?

       

      Can someone shed some light on this.

       

      Thanks

       

      Jon Whitcraft
      Indianapolis Motor Speedway
      jwhitcraft@...

      Phone: (317) 492-8623 :: Fax: (317) 492-6419

       

      ********************
      ********************
      This E-mail (and attachments) may contain confidential/privileged information intended only for the named addressee(s). If you are not an intended recipient, do not read, copy, disseminate or take any action based on the content of this E-mail. Please notify the sender by reply E-mail and erase this E-mail from your system. Your assistance is appreciated. E-mail transmission may not be secure or error-free. The company is not responsible for any loss/damage arising from any virus transmitted.
      ********************
      ********************
    Your message has been successfully submitted and would be delivered to recipients shortly.