Issue
So, i was working on the animation of a football field in 3D with css. this is what i have and this should be what i would like to have
my codes are the following,they are all taken from this repository, i've only added the tags body,head and html.
html: https://codepen.io/paulnoble/pen/PwOxOY.html
css:https://codepen.io/paulnoble/pen/PwOxOY.css
and this is the js: https://codepen.io/paulnoble/pen/PwOxOY.js inside my project, i've already added velocity.min.js e jquery.min.js.
the full repository is at https://codepen.io/paulnoble/details/PwOxOY
and i'm having this error here.
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>
how can i solve this error? Admitting it would be the only one. this my 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>
Solution
You just have to add jquery scripts before velocity scripts, or it won't work.
Before:
<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>
After:
<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>
Answered By - Felipe Malara
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.