0
如何使用輸入框對文本進行旋轉操作旋轉。我使用鼠標進行文本旋轉,但是當我使用可拖動的時候,這非常複雜。 請幫我使用輸入框的圖像旋轉?
如何使用輸入框對文本進行旋轉操作旋轉。我使用鼠標進行文本旋轉,但是當我使用可拖動的時候,這非常複雜。 請幫我使用輸入框的圖像旋轉?
我希望這會引導你完成它
$(document).ready(function(){
$("#rotateButton").click(function(){
var x= $("#rotateInput").val();
$("#rotate").css('transform','rotate(' + x + 'deg)');
});
});
#rotate{
background: url('https://cdn2.iconfinder.com/data/icons/faceavatars/PNG/D04.png');
width: 180px;
height:150px;
background-repeat:no-repeat;
margin:40px auto;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="rotate"></div>
<input id="rotateInput" type="text" value="0">
<button id="rotateButton">Rotate It</button>
非常感謝,這正是我想要的 – johndoe
歡迎您投上一票。 –