Since it returns an object, you can use either dot notation or bracket notation. So, to get the top position of an element, you could do this ...

$(element).offset().top

or this ...

$(element).offset()['top']

hope that helps.

--Karl
_________________
Karl Swedberg
www.englishrules.com
www.learningjquery.com



On May 1, 2008, at 3:56 PM, bdee1 wrote:



i am a little unclear on how exactly to get the position of an element using
jquery dimensions plugin.

documentation says it returns "An object with top and left properties that
are numbers representing the offset in pixels."

and it says the object looks like this:
{ top: 10, left: 10 }

so how do i access it? like a string? do i have to use string functions to
pull out the height and width individually?
--
View this message in context: 
http://www.nabble.com/dimensiosn-plugin-tp16995030s27240p16995030.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.


Reply via email to