gpt4 book ai didi

javascript - 此特定动画的 javascript 问题

转载 作者:太空宇宙 更新时间:2023-11-04 05:35:35 24 4
gpt4 key购买 nike

所以,我正在使用 CSS 制作 3D 足球场动画。这就是我所拥有的 enter image description here这应该是我想要的what i would like to have

我的代码如下,它们都取自这个库,我只添加了标签 body,head 和 html。

html: https://codepen.io/paulnoble/pen/PwOxOY.html
CSS:https://codepen.io/paulnoble/pen/PwOxOY.css
这是 js:https://codepen.io/paulnoble/pen/PwOxOY.js在我的元素中,我已经添加了 velocity.min.js e jquery.min.js。
完整的存储库位于 https://codepen.io/paulnoble/details/PwOxOY

我这里有这个错误。

campo.js:428 Uncaught TypeError: $teamListHome.velocity is not a function <br>
at Object.preLoad (campo.js:428) <br>
at init (campo.js:660) <br>
at HTMLDocument.<anonymous> (campo.js:667) <br>
at i (jquery-1.12.1.min.js:2) <br>
at Object.fireWith [as resolveWith] (jquery-1.12.1.min.js:2) <br>
at Function.ready (jquery-1.12.1.min.js:2) <br>
at HTMLDocument.K (jquery-1.12.1.min.js:2) <br>

我该如何解决这个错误?承认它是唯一的。这是我的 html

    
<script src="https://cdnjs.cloudflare.com/ajax/libs/velocity/1.2.2/velocity.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<link href="https://codepen.io/paulnoble/pen/PwOxOY.css" rel="stylesheet"/>
<script src="https://codepen.io/paulnoble/pen/PwOxOY.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<head>
<meta charset="ISO-8859-1">
<title>Formazione</title>
<%@include file="header.html"%>
</head>
<body>
<main>
<div class="static">
<h1 class="js-heading">FOOTBALL LEAGUE</h1>
<p class="js-subheading">Experimental team line-up and football field using CSS 3D transforms.<br><span style="font-size: 11px">Currently buggy in Chrome, will fix soon :)</span></p>
<div class="js-switcher switcher">
<a href="#" class="js-switch disabled switch-btn">HOME</a><a href="#" class="js-switch switch-btn">AWAY</a>
</div>
</div>
<div class="js-stage stage texture">
<div class="js-world world">
<div class="team js-team">
<!-- Team cards / icons goes here -->
</div>
<div class="terrain js-terrain">
<div class="field field--alt"></div>
<div class="field ground">
<div class="field__texture field__texture--gradient"></div>
<div class="field__texture field__texture--gradient-b"></div>
<div class="field__texture field__texture--grass"></div>
<div class="field__line field__line--goal"></div>
<div class="field__line field__line--goal field__line--goal--far"></div>
<div class="field__line field__line--outline"></div>
<div class="field__line field__line--penalty"></div>
<div class="field__line field__line--penalty-arc"></div>
<div class="field__line field__line--penalty-arc field__line--penalty-arc--far"></div>
<div class="field__line field__line--mid"></div>
<div class="field__line field__line--circle"></div>
<div class="field__line field__line--penalty field__line--penalty--far"></div>
</div>
<div class="field__side field__side--front"></div>
<div class="field__side field__side--left"></div>
<div class="field__side field__side--right"></div>
<div class="field__side field__side--back"></div>
</div>
</div>
<div class="loading js-loading">PLEASE WAIT...</div>
</div>
</main>




</body>
</html>

最佳答案

只需在 velocity 脚本之前添加 jquery 脚本,否则它不会工作。

之前:

<script src="https://cdnjs.cloudflare.com/ajax/libs/velocity/1.2.2/velocity.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<link href="https://codepen.io/paulnoble/pen/PwOxOY.css" rel="stylesheet"/>
<script src="https://codepen.io/paulnoble/pen/PwOxOY.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

之后:

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/velocity/1.2.2/velocity.min.js"></script>
<link href="https://codepen.io/paulnoble/pen/PwOxOY.css" rel="stylesheet"/>
<script src="https://codepen.io/paulnoble/pen/PwOxOY.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

关于javascript - 此特定动画的 javascript 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59706517/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com