Open jeansevilla opened 4 years ago
Hi, the formatting of the code didn't come through clear, but this seems to be a Javascript issue. If you declare the same variable multiple times in the same scope, your variable will change the reference to the last instance you defined. You probably want to individually scope each one of the instances.
Hi, the formatting of the code didn't come through clear, but this seems to be a Javascript issue. If you declare the same variable multiple times in the same scope, your variable will change the reference to the last instance you defined. You probably want to individually scope each one of the instances.
thank you so much for your prompt reply, you could give me an example, I'm not a programmer so I have a lot of trouble figuring out where I'm wrong. thank you very much!!!
hi, i have multiples animations on the page but just one works, these are the 3 animations. thank you
let anim= lottie.loadAnimation({ container: document.getElementById('face'), renderer: 'svg', loop: true, autoplay: false, path: 'JS/face.json', });
anim.addEventListener('DOMLoaded', (e) => { anim.playSegments([[0,125],[50,125]], true); });
let anim= lottie.loadAnimation({ container: document.getElementById('office'), renderer: 'svg', loop: true, autoplay: false, path: 'JS/office.json', });
anim.addEventListener('DOMLoaded', (e) => { anim.playSegments([[0,225],[50,225]], true); });
container: document.getElementById('maps'), renderer: 'svg', loop: true, autoplay: false, path: 'JS/maps.json', });
anim.addEventListener('DOMLoaded', (e) => { anim.playSegments([[0,250],[50,250]], true); });