After lots of time spent going back and forth with the different browsers and nesting elements I have come up with what I believe is the most accurate cumulative offset function cross browser. I tried everything I could think of to keep the code as simple and small as possible. I tried to use proprietary methods where I could but even still those didn't give the expected results constantly.
I'm planning on posting up all my 'extenstions' that I've made to prototype over the last couple of months when I have the time. So I went ahead and setup a blog ( http://brandonaaron.net/) and the first entry is about this with the code for an Element.getOffset Method. I've included 29 assertions as well.
I've very quickly detailed a little about the method (including the options), posted the code and unit tests.
Article
http://brandonaaron.net/articles/2006/08/10/prototype-extensions-element-getoffset
Code
http://brandonaaron.net/prototype/src/dom.js
Unit test
http://brandonaaron.net/prototype/test/unit/dom.html
Let me know if it works for you and if it does then I'll submit a patch. I've been using it successfully for a couple of months now. I also went throught he current patches and they did not fix all problems across all browsers. Most of the problems come with nested positioned elements.
_______________________________________________ Rails-spinoffs mailing list Rails-spinoffs@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs