Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jquery-ui/2.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
Jquery ui jqueryUI的步长值是否可调整?_Jquery Ui_Resizable_Jquery Ui Resizable - Fatal编程技术网

Jquery ui jqueryUI的步长值是否可调整?

Jquery ui jqueryUI的步长值是否可调整?,jquery-ui,resizable,jquery-ui-resizable,Jquery Ui,Resizable,Jquery Ui Resizable,对于其他jquery交互/小部件,有步骤值 如何强制调整大小以增加/减少到特定值 我必须这样做吗? 另一个问题是,为了更有效的破解,我如何知道哪个罗盘点正在调整大小 var desiredStepPixels = 8; var containmentLeftPos = 100; var containmentTopPos = 250; $("#resizeDivID").resizable({ resize: function( event, ui ) { var new

对于其他jquery交互/小部件,有步骤值

如何强制调整大小以增加/减少到特定值

我必须这样做吗? 另一个问题是,为了更有效的破解,我如何知道哪个罗盘点正在调整大小

var desiredStepPixels = 8;
var containmentLeftPos = 100;
var containmentTopPos = 250;

$("#resizeDivID").resizable({
    resize: function( event, ui ) {
       var newLeftPxValue = $("#resizeDivID").css("left");
       var leftPxModulus = (newLeftPxValue - containmentLeftPos ) % desiredStepPixels;
       if ( leftPxModulus != 0){
            if (leftPxModulus>(desiredStepPixels/2)){
                var forcedNewLeftPx = newLeftPxValue + (desiredStepPixels - leftPxModulus);
                $("#resizeDivID").css({"left":forcedNewLeftPx});    
            }else{
                //force a round down on the left side
            }
       }
       //and then etc etc for top, width and height!
    }
});

对不起,对不起。当然Jquery已经想到了这一点

它叫网格

很抱歉,我已经检查了文档,但没有看到我要找的东西