I am trying to use velocity.js to rotate a div
.
When I code it in codepen it works with no problem but when I try to run it in my html it does not. What am I doing wrong? I want to pull my hair out.
Here's the code:
HTML
<div id="first"></div>
CSS
#first {
width:300px;
height:300px;
background-color: red;
}
JS
$(document).ready(function(){
$("#first").velocity({ rotateZ: 360 }, {
duration: 6000, loop:true
easing: [ 0.80, 0.80, 0.80, 0.70 ];
});
});`
Using velocity library at:
http://cdn.jsdelivr.net/velocity/1.1.0/velocity.min.js
Your object has a syntax error
should not have a semicolon.
needs a comma after it