嗨,我们使用jquery rotatble插件旋转一个divjQuery的旋转()在程度
$(function() {
$('.new-multiple').rotatable();
});
.new-multiple{
display:inline-block;
}
<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/godswearhats/[email protected]/jquery.ui.rotatable.css">
<script src="https://cdn.jsdelivr.net/gh/godswearhats/[email protected]/jquery.ui.rotatable.min.js"></script>
<div class="new-multiple">
<img src="https://www.gravatar.com/avatar/322f808cb7a7e06d38ca4c8a441332fd?s=48&d=identicon&r=PG&f=1">
</div>
但问题是,它利用辐射的选择转动股利。但我们需要旋转div使用度。即0到360度。如何如果您查看在https://github.com/godswearhats/jquery-ui-rotatable的文档,我们可以做到这一点
我试图
.rotatable({
options: {
degrees: true
}
});
,但是这是不工作
看一看[这](https://www.w3schools.com/tags/ tryit.asp?filename = tryhtml5_canvas_rotate) – matt
@matt不知道Canvas旋转是如何与jQuery UI插件和CSS相关的。 – Twisty