1. #1
    Sencha User
    Join Date
    Apr 2008
    Location
    West Linton, Scotland
    Posts
    244
    Vote Rating
    0
    andycramb is on a distinguished road

      0  

    Default Unanswered: optional animation

    Unanswered: optional animation


    I am syncing an animation on a div that synchronises the animation on scrolling and on height.
    The height animation is optional depending on a passed in config parameter(this.animateHeight).
    I have this working in the code below but it looks cumbersome.
    Is there a better way to achieve this?

    Code:
            if(this.animateHeight === true){
            
                this.outerSlidesBox.syncFx().animate(
                    {
                        scroll: {to: [scrollAmount,0]}
                    },
                    this.fxDuration,
                    null,
                    'easeBoth',
                    'scroll'
                ).animate(
                    {
                     height: {to:el.getHeight()}
                    },
                    this.fxDuration,
                    null,      
                    'easeOut', 
                    'run'
                );
            
            }
            else{
                this.outerSlidesBox.animate(
                    {
                        scroll: {to: [scrollAmount,0]}
                    },
                    this.fxDuration,
                    null,
                    'easeBoth',
                    'scroll'
                );
                
                this.outerSlidesBox.setHeight(el.getHeight());
            }

  2. #2
    Sencha User steffenk's Avatar
    Join Date
    Jul 2007
    Location
    Haan, Germany
    Posts
    2,657
    Answers
    4
    Vote Rating
    6
    steffenk has a spectacular aura about steffenk has a spectacular aura about steffenk has a spectacular aura about

      0  

    Default


    have a look at lightbox, it does the same.
    vg Steffen
    --------------------------------------
    Release Manager of TYPO3 4.5

  3. #3
    Sencha User
    Join Date
    Apr 2008
    Location
    West Linton, Scotland
    Posts
    244
    Vote Rating
    0
    andycramb is on a distinguished road

      0  

    Default


    Thanks will do

Thread Participants: 1