Initialize jQuery?

143 Views Asked by At

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

1

There are 1 best solutions below

0
On BEST ANSWER

Your object has a syntax error

easing: [ 0.80, 0.80, 0.80, 0.70 ];

should not have a semicolon.

loop:true

needs a comma after it