[jQuery] Re: Why isn't there top() and left() methods in the dimension plugin ?

2007-08-28 Thread Sam Collett
On Aug 28, 1:59 pm, "Olivier Percebois-Garve" <[EMAIL PROTECTED]> wrote: > Wow your too fast guys. > It seems that I was using offset() the wrong way. > > $left = element.offset().left; > $top = element.offset().top; The only problem with that is you are calling offset twice (

[jQuery] Re: Why isn't there top() and left() methods in the dimension plugin ?

2007-08-28 Thread Olivier Percebois-Garve
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

[jQuery] Re: Why isn't there top() and left() methods in the dimension plugin ?

2007-08-28 Thread Karl Swedberg
Hi Olivier, The Dimensions plugin has a very powerful .offset() method. Perhaps that is what you're looking for? For a demo of Dimemsions methods, check out this companion page to the Dimensions chapter in jQuery Reference Guide: http://book.learningjquery.com/3810_10_code/dimplugin.html

[jQuery] Re: Why isn't there top() and left() methods in the dimension plugin ?

2007-08-28 Thread Brandon Aaron
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 PROTECTE