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 (
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
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
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
4 matches
Mail list logo