quantumbutterfly quantumbutterfly - 3 months ago 30
CSS Question

Velocityjs giving syntax error when css "left" parameter is a percentage

This works:

Velocity(document.getElementsByClassName('center')[0], { left:50 }, { duration: 1000 });

This doesn't:

Velocity(document.getElementsByClassName('center')[0], { left:50% }, { duration: 1000 });

With this I get
Uncaught SyntaxError: Unexpected token }

I need to animate this such that the css
property is 50%. How can I do this?


Nevermind I figured it out.

Solution was to put "50%" in quotes