1. #1
    Sencha User
    Join Date
    Oct 2011
    Posts
    6
    Vote Rating
    0
    Preexo is on a distinguished road

      0  

    Default Unanswered: Ext JS 4 Animator

    Unanswered: Ext JS 4 Animator


    Hi,

    Since today I'm trying to get into Ext JS 4. Compared to Mootools: I love it.

    After I tried a lot of basic functions, I wanted to create a slide effect with the animator. It worked perfectly. Then I tried to stop the animation at some point. But nothing happened. Really nothing.

    Here's my code... But why the heck doesn't happen anything, when the code hits the end() function?
    I thought, the animation should stop instantly or am I on the wrong way. Is there another way to stop an animation?

    Code:
    var animator = Ext.create('Ext.fx.Animator', {
            target: Ext.get('contentu'),
            duration: 1000,
            keyframes: {
                0: {
                    x: 0
                },
                1000: {
                    x: -2076
                }
            }
        });
    
    animator.end();

  2. #2
    Sencha User
    Join Date
    Oct 2011
    Posts
    6
    Vote Rating
    0
    Preexo is on a distinguished road

      0  

    Default


    I now tried to animate the slide with the animate() method on the Element like this:

    Code:
    contentUnten.animate({
                duration : 10000,
                to : {
                    x : -2076
                }
            });
    Works good and with
    Code:
    contentUnten.stopAnimation();
    the animation acually stops, halelulja.

    But is it somehow possible to change a running animation like the to.x value?

    Thanks for any help!