Lottie-web: lottie.resize() documentation

Created on 13 Jul 2020  路  2Comments  路  Source: airbnb/lottie-web

Hi Hernan, are there any documentation or examples on lottie.resize() function? I can't find anything I can use. The idea is to use this function to resize an animation instance depending on different conditions. Tried to use viewBoxSize, but couldn't make it work. Thanks a lot in advance.

Most helpful comment

Got it, many thanks! Yes, adding a class to svg element and and then changing it with the style.transform does the trick. Thank you!

All 2 comments

Hi, the resize method is something you need to call if you are using the html or canvas renderers in order for them to redraw correctly.
Not sure what you need to do, but using transforms on the svg element, or modifying the viewBox value of the svg element are possible solutions for this as well.

Got it, many thanks! Yes, adding a class to svg element and and then changing it with the style.transform does the trick. Thank you!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

RenanSgorlom picture RenanSgorlom  路  3Comments

zhengs picture zhengs  路  3Comments

deborabm picture deborabm  路  3Comments

ritsraghani picture ritsraghani  路  3Comments

hardy613 picture hardy613  路  4Comments