I cant seem to find an effect to move an element to a given XY position
new Effect.Move(''elid'',{x:10, y:10});
Will move the element 10px down and 10px to the right, but I want to
move my element to 10px from the top left corner of the page.
I know I could find the current position, and do the math to find out
how far to move it, but is there already a built in function in
script.aculo.us or prototype to do this?
Cheers
______________________________________________________________________
Alex Duffield . Principal . InControl Solutions . http://
www.incontrolsolutions.com
_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Alex,
You need to use the new effect "Move". There is a 'mode'
option that
can either be 'absolute' or 'relative'. You want the
'absolute'
version.
Here's an example:
new Effect.Move('elid', { x: 10, y: 10, mode: 'absolute'});
regards,
Cam
On 1/20/06, Alex Duffield <alex@incontrolsolutions.com>
wrote:> I cant seem to find an effect to move an element to a given XY position
>
> new Effect.Move('elid',{x:10, y:10});
>
> Will move the element 10px down and 10px to the right, but I want to move
my
> element to 10px from the top left corner of the page.
>
> I know I could find the current position, and do the math to find out how
> far to move it, but is there already a built in function in script.aculo.us
> or prototype to do this?
>
> Cheers
>
>
> ______________________________________________________________________
>
> Alex Duffield . Principal . InControl Solutions .
> http://www.incontrolsolutions.com
>
>
>
>
>
> _______________________________________________
> Rails-spinoffs mailing list
> Rails-spinoffs@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
>
>
>
--
Cam McVey
cam.mcvey@gmail.com
_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Perfect, thank you kindly sir! ______________________________________________________________________ Alex Duffield . Principal . InControl Solutions . http:// www.incontrolsolutions.com On 20-Jan-06, at 8:01 AM, Cam McVey wrote:> Alex, > > You need to use the new effect "Move". There is a ''mode'' option that > can either be ''absolute'' or ''relative''. You want the ''absolute'' > version. > > Here''s an example: > > new Effect.Move(''elid'', { x: 10, y: 10, mode: ''absolute''}); > > > regards, > Cam > > On 1/20/06, Alex Duffield <alex-GLL9njBnHiGqPKKiFzS5XxZCeNDtXRbv@public.gmane.org> wrote: >> I cant seem to find an effect to move an element to a given XY >> position >> >> new Effect.Move(''elid'',{x:10, y:10}); >> >> Will move the element 10px down and 10px to the right, but I want >> to move my >> element to 10px from the top left corner of the page. >> >> I know I could find the current position, and do the math to find >> out how >> far to move it, but is there already a built in function in >> script.aculo.us >> or prototype to do this? >> >> Cheers >> >> >> _____________________________________________________________________ >> _ >> >> Alex Duffield . Principal . InControl Solutions . >> http://www.incontrolsolutions.com >> >> >> >> >> >> _______________________________________________ >> Rails-spinoffs mailing list >> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >> >> >> > > > -- > > Cam McVey > cam.mcvey-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs_______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs