#665 ✓fixed_in_master_branch
didiblo

Bug resolved cumulativeOffset

Reported by didiblo | April 27th, 2009 @ 10:37 AM

Hello,

We have found a little bug in the cumulativeOffset function in the prototype.js file (v1.6.3).
RubyOnRails suggest this solution:

@@ -1805,9 +1805,11 @@
   cumulativeOffset: function(element) {
     var valueT = 0, valueL = 0;
     do {
-      valueT += element.offsetTop  || 0;
-      valueL += element.offsetLeft || 0;
-      element = element.offsetParent;
+        valueT += element.offsetTop  || 0;
+        valueL += element.offsetLeft || 0;
+        if (typeof element.offsetParent == 'undefined' || typeof element.offsetParent == 'unknown')
+          break;
+        element = element.offsetParent;
     } while (element);
     return [valueL, valueT];
   },

You can find this here http://dev.rubyonrails.org/ticket/5515.

We have find the link thanks to a google forum http://groups.google.com/group/prototype-core/browse_thread/thread/...

We have tested the solution and it works very well.

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

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

The Prototype JavaScript library.

Shared Ticket Bins

Referenced by

Pages