I have the following code which sets the rotational angle on the element:
$('#1-link-2')
.css('height', length)
.css('-webkit-transform', 'rotate(' + angle + 'deg)')
.css('-moz-transform', 'rotate(' + angle + 'deg)')
.css('-o-transform', 'rotate(' + angle + 'deg)')
.css('-ms-transform', 'rotate(' + angle + 'deg)')
.css('transform', 'rotate(' + angle + 'deg)');
where angle is dynamically calculated previously (its based on the position of the mouse).
I need to be able to retrieve the angle. I tried this for starters:
var angle= $("#1-link-2").css('-webkit-transform');
$('#node-title').html(angle); //just to print it to the screen for me
and it gave me this text
matrix(0.5425908601788315, -0.839997118120292, 0.839997118120292, 0.5425908601788315, 0, 0)
How can I retrieve the angle in degrees?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…