Wow your too fast guys. It seems that I was using offset() the wrong way. $left = element.offset().left; $top = element.offset().top;
is fine for me in replacement of : $errorBoxOffset = {}; element.offset({scroll: false}, $errorBoxOffset); $left = $errorBoxOffset.left; $top = $errorBoxOffset.top; Thanks a lot guys! On 8/28/07, Brandon Aaron <[EMAIL PROTECTED]> wrote: > > You can very easily add these helper methods to your own app like this: > > jQuery.fn.left = function() { > return this.offset({scroll:false}).left; > }; > > jQuery.fn.top = function() { > return this.offset ({scroll:false}).top; > }; > > -- > Brandon Aaron > > On 8/28/07, Olivier Percebois-Garve <[EMAIL PROTECTED] > wrote: > > > > Okay, I'm doing a lot of jQuery today so please pardon me if I'm sending > > too much emails here. > > > > I'm annoyed with the (otherwise great) dimension plugin because there is > > no direct way to get the top > > and left position of an element. > > So all over my code I have things such as : > > > > $errorBoxOffset = {}; > > element.offset({scroll: false}, $errorBoxOffset); > > $left = $errorBoxOffset.left; > > $top = $errorBoxOffset.top; > > > > > > Have I missed something in the dimension doc ? > > Do you think it would make sense to add such functions to the dimensions > > plugin ? > > > > -Olivier > > > > >