-1

I don't know why it don't work. I am using jQuery 2.1.0

I have this code:

$("a.shownav img").rotate(180);

How can I make it work without using a plugin?

KevinT.
  • 272
  • 6
  • 16

2 Answers2

4

for using .rotate(), you need to add jqueryrotate plugin. This can be also achieved using pure jQuery and CSS.

Try this:

$("a.shownav img").css({
    "-webkit-transform": "rotate(180deg)",
    "-moz-transform": "rotate(180deg)",
    "transform": "rotate(180deg)" /* For modern browsers(CSS3)  */
});
Kevin Simper
  • 1,669
  • 19
  • 32
Milind Anantwar
  • 81,290
  • 25
  • 94
  • 125
3

Use .css() in jquery

$("a.shownav img").css("transform", "rotate(180deg)");
Sudharsan S
  • 15,336
  • 3
  • 31
  • 49