Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/apache-flex/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript jQuery rotatable()的度数_Javascript_Jquery_Rotation - Fatal编程技术网

Javascript jQuery rotatable()的度数

Javascript jQuery rotatable()的度数,javascript,jquery,rotation,Javascript,Jquery,Rotation,大家好,我们使用jqueryrotatable插件来旋转div $(函数(){ $('.new multiple').rotatable(); }); 。新建多个{ 显示:内联块; } 如果您在查看文档时看到: 度:以度为单位开始旋转(默认为0) 因此,您无法在尝试时使用该选项。它需要是介于0和360之间的int值,而不是true 例如,如果希望将旋转初始化为45度,可以使用: $(function() { $('.new-multiple').rotatable({ degre

大家好,我们使用jqueryrotatable插件来旋转div

$(函数(){
$('.new multiple').rotatable();
});
。新建多个{
显示:内联块;
}

如果您在查看文档时看到:

:以度为单位开始旋转(默认为0)

因此,您无法在尝试时使用该选项。它需要是介于0和360之间的
int
值,而不是
true

例如,如果希望将旋转初始化为45度,可以使用:

$(function() {
  $('.new-multiple').rotatable({
    degress: 45
  });
});

希望这会有帮助。

因为我需要以度为单位获得旋转,我在停止事件中将给定弧度转换为度

$('.new-multiple').rotatable({


        stop: function(e, ui){
             if(ui.angle.current<0){
                   var given_angle=ui.angle.current+2*Math.PI;
                }
                else{ var given_angle=ui.angle.current;  }
                var new_angle=Math.round(given_angle*180/ Math.PI)+"deg";
                $(".new-multiple").css("transform","rotate("+new_angle+")");
        }

    });
$('.new multiple')。可旋转({
停止:功能(e、ui){

如果(ui.angle.current)查看一下@matt,我不确定画布旋转与jQuery ui插件和CSS之间的关系。
ui.angle.degree
为您提供了度。我将对此进行检查。这意味着$(“.new multiple”).CSS(“变换”,“旋转”(+ui.angle.degree+”)?