Richard,

Thank you for the fast response!

I understand what it does in the sense of what coord it returns, maybe I should 
explain the question better.

e.getY() (if triggered on the inside of a layer) gives us the y-coord of the event on 
the dynlayer, if triggered on the document, it should be the same as e.getPageY().

e.getPageY() should always return the y-coord of the event on the document.

For example, if a dynlayer's y-position is 100, and the event's y-coord is 10 pixels 
within the layer, then e.getY() will return 10, and e.getPageY() will return 110.

Now in a large page (one that has to be scrolled) should this change? I mean, the 
e.pageY is still 110 pixels down from the top pf the page.

Subtracting the window.pageYOffset from the e.pageX will result in an incorrect 
position on the document.

If we want to get the value of the subtracted offset, shouldn't we create an extra 
property of the event to hold this value? 
ie:

if (is.ns) {
    //x/y-coords
    this.x=e.layerX;
    this.y=e.layerY;

    //pageX/Y-coords
    this.pageX=e.pageX;
    this.pageY=e.pageY;

    //offsetX/Y-coords
    this.offsetX=e.pageX-window.pageXOffset;
    this.offsetY=e.pageY-window.pageYOffset;
}

NOTE: the way that it currently is in IE, the pageX works how I suggest.

But I am still confused on what it is that we really want here... can anyone please 
give me an answer on what is intended here?

Thanks again in advance...

--proteanman



On Tue, 06 February 2001, "Richard Bennett" wrote:

> 
> I think that's so that on large pages, when you've scrolled down, the x/y
> compensates the scrollbar.
> I seem to remember that to get it the same as in IE you had to add 20 or
> something.
> 
> Cheers,
> Richard Bennett
> 
> [EMAIL PROTECTED]
> www.richardinfo.com
> (Everything running on, and ported to the 19/12/2000 snapshot of DynAPI2)
> 
> ----- Original Message -----
> From: <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, February 06, 2001 7:46 PM
> Subject: [Dynapi-Help] events.js: mouse event .pageX/Y
> 
> 
> > I have a question.
> >
> > In events.js, setEvent method:
> >
> > why exactly do we do the following instead of just using e.pageX?
> >
> > if (is.ns) {
> >     this.pageX=e.pageX-window.pageXOffset;
> >     this.pageY=e.pageY-window.pageYOffset;
> > }
> >
> > When I change the above to the following,
> >
> > if (is.ns) {
> >     this.pageX=e.pageX;
> >     this.pageY=e.pageY;
> > }
> >
> > Not only does everything appear to be working (mousemove event coords,
> dragging, etc.) correctly, but the pageX/Y now match the same coords as in
> IE (it didn't before).
> >
> > Can anyone answer this?
> >
> > Is there a reason for it?
> >
> > Thanks in advance,
> >
> > --proteanman
> >
> > _______________________________________________
> > Dynapi-Help mailing list
> > [EMAIL PROTECTED]
> > http://lists.sourceforge.net/lists/listinfo/dynapi-help
> > ____________________________________________________________
> > Get your free domain name and domain-based e-mail from
> > Namezero.com. New!  Namezero Plus domains now available.
> > Find out more at: http://www.namezero.com
> >
> 
> 
> _______________________________________________
> Dynapi-Help mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/dynapi-help

_______________________________________________
Dynapi-Help mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dynapi-help

Reply via email to