小编myt*_*ech的帖子

为什么anime.js 不工作?

我正在尝试将anime.js 加载到我的网站中,但它不起作用。我已经下载了 .ZIP 并将其放入名为 /js/ 的子​​文件夹中并正确引用。我什至可以在 Chrome 的检查源中查看anime.min.js 文件。

  <body>
    <div class="container">
    <div class="section center">
      <h1 class="title"></h1>      
          <section>
                <div class="purple"></div>
                <div class="darkgreen"></div>
                <div class="darkred"></div>
            </div>
          </div>
          </section>      
      </div>
    </div>
  <footer class="center">


    <p>CREATED BY HARRY BENDIX-LEWIS | 2017</p>
      </footer>
      <script src="js/anime.min.js" type="text/javascript">
      window.onload = function() {
      anime({
      targets: ['.purple', '.darkgreen', '.darkred'],
      rotate: 360,
      borderRadius: '50%',
      duration: 3000,
      loop: true
    });
    }
      </script>
    </body>
Run Code Online (Sandbox Code Playgroud)

我也有:

<script src="js/anime.min.js"></script>
Run Code Online (Sandbox Code Playgroud)

在我脑海中。

编辑:忘记了我的 CSS

div {
    height: 50px;
  width: 50px;
    margin: 10px;
}

.purple {
    background-color: …
Run Code Online (Sandbox Code Playgroud)

javascript animation

2
推荐指数
1
解决办法
5701
查看次数

标签 统计

animation ×1

javascript ×1