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?
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?
Yeah I know that's how you do it in CSS. I was wondering how to phrase that in JavaScript.
http://code.google.com/p/jquery-rotate/ a plugin you could use that is similar to the CSS3 transform
Is there really no way to do it in plain JavaScipt, without jquery?
jQuery is just a JavaScript library. The JavaScript syntax should be : object.style.transform="rotate(45deg)"
Thank you!
That's the answer I was looking for.
But what about the -moz-?
Yea, sorry missed the Firefox detail. For Firefox, try...
document.getElementById('elementID').style.MozTransform = 'rotate(45deg)';
Thanks a bunch! Worked like a charm.
great to hear. feel free to mark the thread as solved if you do not require any other help.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.