Hi Frederic..

On Jul 24, 9:47 am, Frederic Gaus <[EMAIL PROTECTED]> wrote:

> > may be you have a similar problem when using cumulativeOffset()..
> Yes, your right, this is my problem - not as I first thought the Z-index.
> Could you post your fixed code so that I can try it?

I thought i did this in another thread but it seems that i replied to
the original author instead of this group..

Since i'm new to this stuff, i don't know if this fix is correct.. it
works for me and solved my problem..

in the original thread, where i found a similar patch, the border of
the starting element was also added to caculate the offset..
(without the if(element)  ).. but that resulted in getting the
cumulativ absolute postion of top left corner within the border of the
crurrent element..

my solution returns the top left coordinates where the border of the
starting element starts.. so that Position.within() returns the
expected true/falses
when used in conjunction with Event.pointerX() and Event.pointerY()..

but just have a try and if it works for you too, we can upstream it
through the bug tracker or somehow.. 8)

here is my fix..

regards... marius..

p.s.: i used prototype 1.5.1.1 ..

--- prototype.js.1.5.1.1      2007-06-20 02:31:38.000000000 +0200
+++ prototype.js        2007-07-24 16:44:06.000000000 +0200
@@ -3085,6 +3085,11 @@
       valueT += element.offsetTop  || 0;
       valueL += element.offsetLeft || 0;
       element = element.offsetParent;
+
+      if(element) {
+        valueT += parseInt(Element.getStyle(element,
'borderTopWidth')) || 0;
+        valueL += parseInt(Element.getStyle(element,
'borderLeftWidth')) || 0;
+      }
     } while (element);
     return [valueL, valueT];
   },



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to