This project is archived and is in readonly mode.

#628 ✓wontfix

getcoordinates returns wrong data in opera 9.01

Reported by ethaniel | March 25th, 2009 @ 07:35 AM | in 1.3.0 rc2 (closed)

I have noticed, that while using getCoordinates with older Opera version (like 9.01, 9.24, etc), the value returned is somehow different from what it should be.

For example, here is a piece of code. I have done tests on both mootools code and some other code i found on the internet:

<script type="text/javascript" src=""></script>
<div style="width:790px;margin:0px auto;padding:0px 5px">
<div id="mymenubutton" style="display:inline">123</div>

mootools getcoordinates.left:

function Dimensions(left, top, width, height) {
	this.left = left; = top;
	this.width = width;
	this.height = height;

function getDimensions(control) {
	var tmp = control;
	var left = 0;
	var top = 0;

	while (tmp != null) {
		left += tmp.offsetLeft;
		top += tmp.offsetTop;
		tmp = tmp.offsetParent;

	return new Dimensions(left, top, control.offsetWidth, control.offsetHeight);

getdimensions: <script>document.write(getDimensions($('mymenubutton')).left);</script><br>

In firefox and latest opera it returns:

mootools getcoordinates.left: 405
getdimensions: 405

In older opera it returns:

mootools getcoordinates.left: 0
getdimensions: 405

getCoordinates().left (and .right too) are totally broken in older Opera, when used on a website, they return negative values.

Comments and changes to this ticket

  • fakedarren

    fakedarren February 8th, 2010 @ 05:36 PM

    • State changed from “new” to “hold”
    • Assigned user set to “fakedarren”
    • Milestone changed from 2.0 to 1.3.0 rc2

    Putting this on hold. Numerous issues around coordinates and positioning - I assume this has been fixed in recent releases. Ethaniel - can you confirm?

    If not I will get round to testing eventually.

  • Christoph Pojer

    Christoph Pojer November 9th, 2010 @ 07:25 PM

    • State changed from “hold” to “wontfix”
    • Milestone order changed from “0” to “0”

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Shared Ticket Bins

People watching this ticket