How to get CSS transform rotation value in degrees with JavaScript
问题 I'm using the code found at CSS-Tricks to get the current rotation transform (in CSS) with JavaScript. JavaScript function: function getCurrentRotation( elid ) { var el = document.getElementById(elid); var st = window.getComputedStyle(el, null); var tr = st.getPropertyValue("-webkit-transform") || st.getPropertyValue("-moz-transform") || st.getPropertyValue("-ms-transform") || st.getPropertyValue("-o-transform") || st.getPropertyValue("transform") || "fail..."; if( tr !== "none") { console