airbnb / lottie-web

Render After Effects animations natively on Web, Android and iOS, and React Native. http://airbnb.io/lottie/
MIT License
30.54k stars 2.87k forks source link

Can anyone help me see why I can't show the animation? #1175

Open wyfang opened 6 years ago

wyfang commented 6 years ago

I have read all kinds of tutorials, including video tutorials, but they have not been successful. I don't know what went wrong.

201808021451.zip

bodymovin commented 6 years ago

Hi, your folder is named "_js" and the html is looking for a folder called "js". Second, in the index you're passing a variable element as the container of the animation but you haven't specified what is the value of that variable. It should point to an element in the DOM.

wyfang commented 6 years ago

I do not know what to do. >.<

wyfang commented 6 years ago

What mean:

qq20180806-095355

And very strange, you said that the file is "_js", but I see it on the mac, it is really "js", when I pass the file to the win computer, it is really "_js"

wechatimg38 qq20180806-095516

bodymovin commented 6 years ago

You need to use a web server in order to run your project locally. It won't work executing the html directly from your file system.

wyfang commented 6 years ago

The same: http://wangyifang.com/web/123/

bodymovin commented 6 years ago

It's not the same. You're getting a different error. try this and pass the correct path to your json file.

lottie.loadAnimation({
  container: document.getElementById('bm'), // the dom element that will contain the animation
  renderer: 'svg',
  loop: true,
  autoplay: true,
  path: 'data.json' // the path to the animation json
});
wyfang commented 6 years ago

Still not, no animation. qq20180807-132458

wyfang commented 6 years ago

And I can see error in dreamweaver: qq20180807-132732

vetvine88 commented 4 years ago

Hi @wyfang I am also facing the issue. Nothing shows in the animation..

Can you check in https://github.com/airbnb/lottie-web/issues/2121 ?