Madses Madses -5 years ago 219
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,


Answer Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download