1

I'm trying to rotate an image with jQuery on version 1.8.2. I can't change this version.

Here is what I've tried:

$("#test").css("-webkit-transform","rotate(-90deg)")
$("#test").css("-moz-transform","rotate(-90deg)")
$("#test").css("-ms-transform","rotate(-90deg)")
$("#test").css("-o-transform","rotate(-90deg)")
$("#test").css("transform","rotate(-90deg)")
$("#test").tabs('rotate', -90)
$("#test").rotate(-90)
$("#test").rotateAnimation(-90)

None of these lines work

My navigator is a custom one by Samsung on a Smart TV. Here is the result of navigator.userAgent command:

Mozilla/5.0 (SmartHub; SMART-TV; U; Linux/SmartTV+2014; Maple2012) AppleWebKit/537.42+ (KHTML, like Gecko) SmartTV Safari/537.42+

Edit : This seems impossible for now. Does it exist an other way to make a rotation without using HTML5?

Edit2 : Here is some working code:

$("#myVideo-container").get(0).style.webkitTransform = 'scale(-0.5,-0.5)';
$("#myVideo-container").get(0).style.webkitTransform = 'translateY(-600px)';

I've tried to move from video to div rotation but still not rotating.

brcebn
  • 1,571
  • 1
  • 23
  • 46
  • possible duplicate of [How to rotate a div using jQuery](http://stackoverflow.com/questions/3020904/how-to-rotate-a-div-using-jquery) – TylerH Jul 30 '15 at 14:27
  • Also see http://stackoverflow.com/questions/15517966/jquery-rotate-a-div and http://stackoverflow.com/questions/9776015/jquery-animate-a-rotating-div – TylerH Jul 30 '15 at 14:27
  • First are you sure that is jquery working well on your smart TV ? – devseo Jul 30 '15 at 14:31
  • I'm using `jQuery` all long but I can't find how to rotate. I thought the problem came from this old version (September 20th, 2012) but I'm not even sure about that. – brcebn Jul 30 '15 at 14:37
  • @TylerH, my problem is different because it's from a Smart TV. I've tried every single code line you've shared with me. None of these work as I explained on the description. – brcebn Jul 30 '15 at 14:44
  • @bobbystouket try to test if css transforms are supported by your Smart TV browser - you can run this test http://css3test.com/ – easwee Jul 30 '15 at 16:06
  • Thanks for the tip @easwee, I've tried it. It seems that the rotation is possible but when I do it on my Smart TV, nothing happen (or strange things). I've added some positive tests. – brcebn Aug 24 '15 at 09:20

2 Answers2

1

Seems to work for me in this fiddle: https://jsfiddle.net/mbho2bjj/

Of course, JSFiddle only has between jQuery 1.7.2 and 1.8.3 to test with.

I did however add semicolons to the end of your statements.

$("#test").css("-webkit-transform","rotate(-90deg)");
$("#test").css("-moz-transform","rotate(-90deg)");
$("#test").css("-ms-transform","rotate(-90deg)");
$("#test").css("-o-transform","rotate(-90deg)");
$("#test").css("transform","rotate(-90deg)");
$("#test").tabs('rotate', -90);
$("#test").rotate(-90);
$("#test").rotateAnimation(-90);
ahrim
  • 128
  • 6
  • It's also working for me with `Chrome`, `Safari`, `Mozilla` but not on this Smart TV.. – brcebn Jul 30 '15 at 14:40
  • 2
    You should probably tag this question with smart tv or something so experts there can help. – ahrim Jul 30 '15 at 14:45
  • You can import any version of any library (jQuery included) by clicking "External Resources" in JSFiddle and pasting in a link to a CDN. – TylerH Jul 30 '15 at 14:54
0

Probably you don't necessarily need to use jquery. Using JS you can do it very easily.

Try this

document.getElementById("test2").style.transform = "rotate(90deg)";
Shreeram K
  • 1,719
  • 13
  • 22
  • Could you please share the sample widget? – Shreeram K Aug 24 '15 at 09:06
  • I've shared everything I can I think. This is just a rotation that works on Chrome but not on this Smart TV. I've done a `css3test.com` test. The result is strange because it seems possible to rotate but when I do it, it's not working. – brcebn Aug 24 '15 at 09:19