ng-lottie icon indicating copy to clipboard operation
ng-lottie copied to clipboard

change animation size

Open 1pocketaces1 opened this issue 6 years ago • 2 comments

Hi I am wondering if I can change the size of the animation while it is playing. I have tried using CSS transitions to change the container size and also to change the view size with no success

1pocketaces1 avatar Mar 17 '18 00:03 1pocketaces1

Hello.

Yes, you can change the animation size, for that remove the height and width configuration, so it is going to take the default values which are 100%. You can see it in the source code:

lottieAnimationView.component.ts

this.viewWidth = this.width + 'px' || '100%';
this.viewHeight = this.height + 'px' || '100%';

You have to make your html like:

MyComponent.component.html

 <lottie-animation-view
          [options]=lottieConfig
          (animCreated)="handleAnimation($event)">
    </lottie-animation-view>

The animation is going to take the width of the div container. If you want to change it, change the css configuration of the container.

laulaaa avatar Apr 21 '18 23:04 laulaaa

I tried but it is not taking full height and width of container.

ansarikhurshid786 avatar Jul 10 '19 07:07 ansarikhurshid786