I am available to rotate an html object with JavaScript based on touch, but whenever I touch the screen again, it rotates to that value instead of rotating relative to its rotations
(我可以使用基于触摸的JavaScript旋转html对象,但是每当我再次触摸屏幕时,它都会旋转到该值,而不是相对于其旋转旋转)
var obj = document.getElementById("obj");
var x1;
function rotate(event) {
x1 = event.touches[0].clientX + (window.innerWidth / 2);
var objRx = 360 / (window.innerWidth / x1);
obj.style.transform = "rotateY(" + objRx + "deg)";
}
ask by WileyR translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…