Fx.Move

0 views
Skip to first unread message

Trevor Orr

unread,
Nov 5, 2009, 11:57:13 AM11/5/09
to mootool...@googlegroups.com
I am trying to use the Fx.Move to move an image from the off the right side of the browser window to off the left side of the window but it always stops the the edge of the browser window at both top and left edges.  This works fine if I move it from left to right, the image moves past the edge of the window.  Am I missing something here or will it just not move to negative positions?


        var mover = new Fx.Move($('moveObj'), {
            position: 'upperLeft',
            edge: 'upperRight',
            offset: {x: -300, y: 200},
            duration: 5000
        });
        mover.start();




Aaron Newton

unread,
Nov 5, 2009, 11:58:13 AM11/5/09
to mootool...@googlegroups.com
include the option: allowNegative: true

Trevor Orr

unread,
Nov 6, 2009, 10:34:15 AM11/6/09
to mootools
Can Fx.Move move the specified element to negative coordinates off the left or top of the browser window?



Aaron Newton

unread,
Nov 6, 2009, 12:14:29 PM11/6/09
to mootool...@googlegroups.com
yes, but it defaults to not do this. you have to specify allowNegative = true when the relativeTo is the document.body (the default)

Trevor Orr

unread,
Nov 6, 2009, 12:45:22 PM11/6/09
to mootool...@googlegroups.com
great thanks, this is not documented would be nice to have that in the docs.

Aaron Newton

unread,
Nov 6, 2009, 12:49:19 PM11/6/09
to mootool...@googlegroups.com
* allowNegative - (*boolean*) if *true*, AND the element is not a descendent of an element that is positioned (relative or absolute), then the position will not allow negative values.

that's from the docs of Element.Position (which Fx.Move references).

What's not there is that false is the default. I've added that.

Trevor Orr

unread,
Nov 6, 2009, 1:04:20 PM11/6/09
to mootool...@googlegroups.com
okay thanks, guess I will have to check the referenced classes from now on.

Aaron Newton

unread,
Nov 6, 2009, 2:00:33 PM11/6/09
to mootool...@googlegroups.com
Fx.Move is just Element.Position with a transition applied. Element.position has an option to return the destination coordinates rather than actually moving the element. Fx.Move calls Element.position with this option enabled, getting back the location for the element, and then uses Fx.Morph to move the element.
Reply all
Reply to author
Forward
0 new messages