Madses Madses - 9 months ago 27
jQuery Question

Jquery rotate not working

I have a little button which i want to rotate when i click on it.
I tried the most direct way, which in my opinion is:


This is the way it looks in my code:

$(document).ready(function() {
$(function() {
$('.fa-plus-circle').click(function() {

I went to my browser and opened the console and this is what i saw there:

console error

I tried changing the jquery library from the latest to 1.7.2, that didn't work either. I tried using something different after, I used


And yup, that worked for some reason. It seems to have trouble with "rotate".

Thanks in advance,



There is no method like rotate() in jQuery. You need to use css() method to apply transform.