0

I tried to rotate an element by changing the CSS using this code:

elem.style.-moz-transform:rotate(45deg);

It didn't work, and yes, I'm using firefox to test it.
How should this be done?

3
Contributors
9
Replies
10
Views
4 Years
Discussion Span
Last Post by JorgeM
0

Yeah I know that's how you do it in CSS. I was wondering how to phrase that in JavaScript.

0

Is there really no way to do it in plain JavaScipt, without jquery?

0

jQuery is just a JavaScript library. The JavaScript syntax should be : object.style.transform="rotate(45deg)"

0

Thank you!
That's the answer I was looking for.
But what about the -moz-?

0

Yea, sorry missed the Firefox detail. For Firefox, try...

document.getElementById('elementID').style.MozTransform = 'rotate(45deg)';

0

great to hear. feel free to mark the thread as solved if you do not require any other help.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.