Logo animation by using json by use of bodymovin


#1

In app/components/home-intro.js why it can not use jquery syntax like

$('#logomaincustom') in place of document.getElementById('logomaincustom')

     bodymovin.loadAnimation({
                container: $('#logomaincustom'),
                renderer: 'svg',
                loop: true,
                autoplay: true,
                path: 'data.json',
            });

In app/templates/components/home-intro.hbs <div class=“logomaincustom”> </div>


#3

You can use this type of jQuery plugin, but you’ll need to call it in the didInsertElement hook of a component. More details (and explanation on why that is) available in the guides here: https://guides.emberjs.com/release/components/the-component-lifecycle/