Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#7208 closed defect (duplicate)

dojo.coords x and y values change with page scrolling, but only in some browsers

Reported by: dtgriscom Owned by: sjmiles
Priority: high Milestone: 1.2
Component: HTML Version: 1.1.1
Keywords: coords browser x y Cc: haysmark
Blocked By: Blocking:


dojo.coords returns the x and y values of a given node. In some browsers, these values change when the page is vertically scrolled; in others it doesn't.

Browsers where values change: IE/Win, Foxfire/Win?, Foxfire/Mac? Browsers where values do not: Safari/Win?, Safari/Mac?, OmniWeb/Mac?.

(Question: which would be the correct behavior?)

Change History (3)

comment:1 Changed 14 years ago by bill

Cc: haysmark added
Component: GeneralHTML
Owner: changed from anonymous to sjmiles

Maybe Mark can help here as he's been in the guts of dojo._abs() (which is really doing the work here).

To answer your question, I'll quote the API doc:

//	summary:
//		Gets the position of the passed element relative to
//		the viewport (if includeScroll==false), or relative to the
//		document root (if includeScroll==true).

I'm assuming you are calling dojo.coords() with includeScroll==false (or not specified at all)? Thus IE and Firefox are showing the correct behavior. To put it another way, if you move the scroll bar so a node is at the top of the screen, dojo.coords(node).y should return 0.

comment:2 Changed 14 years ago by haysmark

Milestone: tbd1.2
Resolution: duplicate
Status: newclosed

IE and Firefox have the correct behavior for includeScroll==false. Safari does not.

Dup of #6921. This is a known issue with Safari in 1.1. Will be fixed in 1.2. (BTW, please commit my third patch on that ticket!)

comment:3 Changed 14 years ago by bill

Yup, thanks for the patch on #6921, I checked it in. So did we workaround the safari 1.1 bug?

Note: See TracTickets for help on using tickets.