Javascript jquery可调整大小在90和270角度下无法正常工作

Javascript jquery可调整大小在90和270角度下无法正常工作,javascript,jquery,jquery-ui-resizable,Javascript,Jquery,Jquery Ui Resizable,我正在使用jqueryresizeable插件使用可调整大小的句柄调整元素的大小,但它在旋转元素后不起作用 可调整大小的控制柄及其后续调整大小操作在旋转90度和270度后无法正常工作,因为可调整大小的控制柄不知道旋转角度 在下面的代码中,我只是找到了旋转角度,并根据旋转角度更改了手柄方向,但由于高度和宽度问题,它在90和270处无法正常工作,我试图修复,但无法,请帮助我 $('#screenlayer_'+count+ ' .polaroid').resizable({ hand

我正在使用jqueryresizeable插件使用可调整大小的句柄调整元素的大小,但它在旋转元素后不起作用

可调整大小的控制柄及其后续调整大小操作在旋转90度和270度后无法正常工作,因为可调整大小的控制柄不知道旋转角度

在下面的代码中,我只是找到了旋转角度,并根据旋转角度更改了手柄方向,但由于高度和宽度问题,它在90和270处无法正常工作,我试图修复,但无法,请帮助我

    $('#screenlayer_'+count+ ' .polaroid').resizable({
    handles:'se, sw, ne, nw',
    zIndex : 10000,
    delay: 0,
    create:function() {

    },
    start:function(event, ui){


    },  //start:function(event, ui)
    resize:function(event, ui){
                       var matrix = $(this).css("-webkit-transform") ||
      $(this).css("-moz-transform")    ||
      $(this).css("-ms-transform")     ||
      $(this).css("-o-transform")      ||
      $(this).css("transform");
      if(matrix !== 'none') {
          var values = matrix.split('(')[1].split(')')[0].split(',');
          var a = values[0];
          var b = values[1];
          var angle = Math.round(Math.atan2(b, a) * (180/Math.PI));
      } 
      else { 
          var angle = 0; 
      }
      if(angle < 0) 
          angle +=360;

        console.log(angle)

         if((angle >= 0 && angle  < 45 ) || (angle < 361 && angle >= 315))
      {
          $(this).parent().find('.ui-resizable-sw').css({
              'bottom':'-10px','left':'-10px','top':'','right':''
          });
          $(this).parent().find('.ui-resizable-nw').css({
              'top':'-10px','left':'-10px','bottom':'','right':''
          });
          $(this).parent().find('.ui-resizable-se').css({
              'bottom':'-10px','right':'-10px','top':'','left':''
          });
          $(this).parent().find('.ui-resizable-ne').css({
              'top':'-10px','right':'-10px','bottom':'','left':''
          });
      }
      else if(angle >= 45 && angle < 135)
      {
          $(this).parent().find('.ui-resizable-nw').css({
              'bottom':'-10px','left':'-10px','top':'','right':''
          });
          $(this).parent().find('.ui-resizable-sw').css({
              'bottom':'-10px','right':'-10px','top':'','left':''
          });
          $(this).parent().find('.ui-resizable-ne').css({
              'top':'-10px','left':'-10px','bottom':'','right':''
          });
          $(this).parent().find('.ui-resizable-se').css({
              'top':'-10px','right':'-10px','left':'','bottom':''
          });   
      }
      else if(angle >=135 && angle < 225)
      {
          $(this).parent().find('.ui-resizable-ne').css({
              'bottom': '-10px','left':'-10px','top':'','right':''
          });
          $(this).parent().find('.ui-resizable-nw').css({
              'bottom': '-10px','right':'-10px','top':'','left':''
          });
          $(this).parent().find('.ui-resizable-se').css({
              'top': '-10px','left':'-10px','bottom':'','right':''
          });
          $(this).parent().find('.ui-resizable-sw').css({
              'top': '-10px','right':'-10px','left':'','bottom':''
          });               
      }
      else if(angle >=225 && angle < 315)
      {
          $(this).parent().find('.ui-resizable-se').css({
              'bottom':'-10px','left':'-10px','top':'','right':''
          });
          $(this).parent().find('.ui-resizable-ne').css({
              'bottom':'-10px','right':'-10px','top':'','left':''
          });
          $(this).parent().find('.ui-resizable-sw').css({
              'top': '-10px','left': '-10px','bottom':'','right':''
          });
          $(this).parent().find('.ui-resizable-nw').css({
              'top':'-10px','right':'-10px','left':'','bottom':''
          });   

      }


    },
    stop:function(event , ui) 
    {


    }
}); 
$(“#屏幕层”+count+'.polarioid”)。可调整大小({
手柄:'东南、西南、东北、西北',
zIndex:10000,
延迟:0,
创建:函数(){
},
开始:功能(事件、用户界面){
},//开始:函数(事件,ui)
调整大小:函数(事件、ui){
var matrix=$(this.css(“-webkit transform”)||
$(this.css(“-moz-transform”)||
$(this.css(“-ms transform”)||
$(this.css(“-o-transform”)||
$(this.css(“transform”);
如果(矩阵!=“无”){
var values=matrix.split(“(”)[1]。split(“)”)[0]。split(“,”);
var a=数值[0];
var b=数值[1];
变量角度=数学圆(数学atan2(b,a)*(180/数学PI));
} 
否则{
var角=0;
}
如果(角度<0)
角度+=360;
控制台日志(角度)
如果((角度>=0和角度<45)| |(角度<361和角度>=315))
{
$(this).parent().find('.ui可调整大小的sw').css({
'底部':'-10px','左侧':'-10px','顶部':'','右侧':''
});
$(this).parent().find('.ui可调整大小的nw').css({
“顶部:”-10px“,“左侧:”-10px“,“底部:”,“右侧:”
});
$(this).parent().find('.ui可调整大小的se').css({
'底部':'-10px','右侧':'-10px','顶部':'','左侧':''
});
$(this).parent().find('.ui可调整大小的ne').css({
“顶部:”-10px“,“右侧:”-10px“,“底部:”,“左侧:”
});
}
否则,如果(角度>=45和角度<135)
{
$(this).parent().find('.ui可调整大小的nw').css({
'底部':'-10px','左侧':'-10px','顶部':'','右侧':''
});
$(this).parent().find('.ui可调整大小的sw').css({
'底部':'-10px','右侧':'-10px','顶部':'','左侧':''
});
$(this).parent().find('.ui可调整大小的ne').css({
“顶部:”-10px“,“左侧:”-10px“,“底部:”,“右侧:”
});
$(this).parent().find('.ui可调整大小的se').css({
“顶部:”-10px“,“右侧:”-10px“,“左侧:”,“底部:”
});   
}
否则,如果(角度>=135和角度<225)
{
$(this).parent().find('.ui可调整大小的ne').css({
'底部':'-10px','左侧':'-10px','顶部':'','右侧':''
});
$(this).parent().find('.ui可调整大小的nw').css({
'底部':'-10px','右侧':'-10px','顶部':'','左侧':''
});
$(this).parent().find('.ui可调整大小的se').css({
“顶部:”-10px“,“左侧:”-10px“,“底部:”,“右侧:”
});
$(this).parent().find('.ui可调整大小的sw').css({
“顶部:”-10px“,“右侧:”-10px“,“左侧:”,“底部:”
});               
}
否则如果(角度>=225和角度<315)
{
$(this).parent().find('.ui可调整大小的se').css({
'底部':'-10px','左侧':'-10px','顶部':'','右侧':''
});
$(this).parent().find('.ui可调整大小的ne').css({
'底部':'-10px','右侧':'-10px','顶部':'','左侧':''
});
$(this).parent().find('.ui可调整大小的sw').css({
“顶部:”-10px“,“左侧:”-10px“,“底部:”,“右侧:”
});
$(this).parent().find('.ui可调整大小的nw').css({
“顶部:”-10px“,“右侧:”-10px“,“左侧:”,“底部:”
});   
}
},
停止:功能(事件、用户界面)
{
}
}); 
谢谢你的帮助,谢谢