setElementPosition only the left and top style attributes of an
element. What effect that has depends on whether it's
position:absolute or position:relative.

-bob

On 10/25/06, Steve Slevinski <[EMAIL PROTECTED]> wrote:
>
>  Thanks Bob,
>
>  That makes sense.
>
>  I'm trying to reset an element that was dragged.  The div has a
> position:relative.  I'm calling setElementPosition with 0,0 and it works how
> I want it to work.  I think this makes sense.
>
>  So setElementPosition sets absolute for position: absolute.  But
> setElementPosition moves relative to a div's starting position for
> position:relative.
>
>  Regards,
>  -Steve
>
>  Bob Ippolito wrote:
>  On 10/25/06, Steve Slevinski <[EMAIL PROTECTED]> wrote:
>
>
>  Mochikit 1.4 revision 1176.
>
> According to the documentation setElementPosition sets the absolute
> position of element in the document from an object with x and y
> properties. But this isn't what my code is doing.
>
> According to my code, setElementPosition moves the position of the
> element by the xy values provided.
>
> For an onclick event, the following code will double both the x and y
> positions.
>  this.xy = elementPosition($(this.id));
>  log ("pre position" + this.xy.x + "," + this.xy.y);
>  setElementPosition($(this.id),this.xy);
>  this.xy = elementPosition($(this.id));
>  log ("post position" + this.xy.x + "," + this.xy.y);
>
> If I passed the {x:0,y:0} to the setElementPosition, it worked correctly
> and the div didn't move.
>
>  It does do exactly what's documented, but the element must be
> position:absolute in order for it to work (which should be clarified
> somewhere if it isn't already).
>
> "All" it is doing is setting left and top to the given coordinates. It
> does not screw with other style attributes behind your back.
>
> -bob
>
>
>
>
>
>  >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"MochiKit" group.
To post to this group, send email to mochikit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/mochikit
-~----------~----~----~----~------~----~------~--~---

Reply via email to