我正在玩jquery.rotate.js,我想每次旋转图像到下一个旋转度。
我包括了以下jquery库:
<script type='text/javascript' src='http://code.jquery.com/jquery-1.7.1.js'></script>
<script type='text/javascript' src='jquery.rotate.1-1.js'></script>jQuery代码:
$(window).load(function() {
$("body").on("click", "#button", function() {
$(".north").rotate(a());
});
nextAngle = 0;
function a() {
nextAngle += 90;
if (nextAngle >= 360) nextAngle = 0;
return nextAngle;
}
});HTML代码:
<img class="north" src="https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcSGPgQ8k88yaWVPRytT957hKLV-89QmZtkZc44q45TEDdqe9sKwqg">
<input type="button" id="button" value="Rotate me">我的JSFiddle:示例
在我的当前代码中,图像只旋转一次,但是每次单击按钮事件时,我都想重新调整图像。如何使用jQuery.rotate.js
我要像这样的图像旋转:





知道吗?
谢谢。
发布于 2015-05-22 11:20:05
https://stackoverflow.com/questions/30395285
复制相似问题