[Proto-Scripty] Re: Pause an animation and continue later ?

2008-09-29 Thread lfortin

Hi Sn4ke,

The core effects of Script.aculo.us(like Effect.Move) support a method
called cancel().

For example, you can do:

var myEffect = new Effect.Move(object, { x: 20, y: -30, mode:
'relative', duration: 5.0 });
myEffect.cancel();

Then, you can use the effect object reference(in this example,
myEffect) to stop the move effect whenever you want, and later start
over again with a new move effect.


Here is the documentation of all core effects that support cancel()
method:
http://github.com/madrobby/scriptaculous/wikis/core-effects


Also, if you use JavaScript in a handler such as oumouseover, you
don't need to put "javascript:".
The right way: onmouseover=" ** your code here ** "


-Laurent



On Sep 29, 2:30 am, SN4KE <[EMAIL PROTECTED]> wrote:
> Hi,
>
> i wondered i it is possible to pause and continue an animation.
>
> Like, if I have an div-layer which moves around my Page – I set an
> onmouseover="javascript: $(foo).pause();" and a
> onmouseout="javascript: $(foo).continue();" inside. Are there some
> functions which just do the job?
>
> Is that possible? A simple "pause" and "continue" function?
>
> Greetings
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Pause an animation and continue later ?

2008-09-29 Thread lfortin

Oops ...

Sorry, I replied twice ... :-)

There was a problem with the reply post, so I wrote the message again.

-Laurent


On Sep 29, 2:30 am, SN4KE <[EMAIL PROTECTED]> wrote:
> Hi,
>
> i wondered i it is possible to pause and continue an animation.
>
> Like, if I have an div-layer which moves around my Page – I set an
> onmouseover="javascript: $(foo).pause();" and a
> onmouseout="javascript: $(foo).continue();" inside. Are there some
> functions which just do the job?
>
> Is that possible? A simple "pause" and "continue" function?
>
> Greetings
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Pause an animation and continue later ?

2008-09-29 Thread lfortin

Hi Sn4ke,


It seems that, for core effects with Script.aculo.us(including
Effect.Move), the method cancel() works.

Core effects include: Effect.Highlight, Effect.Morph, Effect.Move,
Effect.Opacity, Effect.Scale, Effect.Parallel, Effect.Tween


So you can do something like:

var myEffect = new Effect.Move(object, { duration: 5.0, x: 20, y: -30,
mode: 'relative' });
myEffect.cancel();

You can keep the effect reference object(in this example, myEffect) to
stop it whenever you want, and start over again later with a new move
effect.


Here is the documentation for Core Effects:
http://github.com/madrobby/scriptaculous/wikis/core-effects


-Laurent



On Sep 29, 2:30 am, SN4KE <[EMAIL PROTECTED]> wrote:
> Hi,
>
> i wondered i it is possible to pause and continue an animation.
>
> Like, if I have an div-layer which moves around my Page – I set an
> onmouseover="javascript: $(foo).pause();" and a
> onmouseout="javascript: $(foo).continue();" inside. Are there some
> functions which just do the job?
>
> Is that possible? A simple "pause" and "continue" function?
>
> Greetings
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---