Hi,
Getting the style properties is easy:
http://www.prototypejs.org/api/element/getStyle
That will return the style properties (e.g., with "px"). In my quick
test, positionedOffset() also worked to get the computed numbers. Are
you sure that when you call positionedOffset(), the DOM is loaded and
the element is visible (e.g., not display: none)?
Hope this helps,
--
T.J. Crowder
tj / crowder software / com
On Apr 3, 9:49 am, Ree <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I have an absolutely positioned element with top and left properties
> set as follows (these are defined in an external stylesheet):
>
> #my-element
> {
> position: absolute;
> top: 5px;
> left: 2px;
> ...
>
> }
>
> Its parent is the body element.
>
> How do I get the top and left values as numbers? I tried $('my-
> element').positionedOffset(), but that returns [0, 0] for some reason.
>
> I must be missing something simple here. Any help would be appreciated.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---