Unable to apply JqueryUI Resizable AspectRatio after initialization?

后端 未结 4 2030
生来不讨喜
生来不讨喜 2021-02-14 11:55

I was trying to turn the aspect ratios on/off dynamically in JQueryUI resizable, however even after setting the option to false, it keeps maintaining the aspect ratio. Below is

4条回答
  •  猫巷女王i
    2021-02-14 12:41

    I realize that this is an old post but in case anyone still needs an answer you can do it like this:

    $('#aspect_check').click( function() {
        var ischecked = $('#aspect_check').prop('checked');
        if (ischecked) {
            $( "#resizable" ).resizable({aspectRatio : .75});
        } else {
            $( "#resizable" ).resizable();
        }
    });
    

提交回复
热议问题