CSS Grid | Gridstack.js - 使一个grid-stack-item小部件具有锁定的aspectRatio

时间:2015-09-27 10:18:27

标签: jquery-ui jquery-ui-resizable

我使用了使用jQueryUI的“Resizable”行为的gridstack(https://github.com/troolee/gridstack.js/tree/master)。我试图在网格中的一个小部件(平铺)上设置aspectRatio:true,但是没有明显的方法可以做到这一点。

这是初始化gridstack的js:

grid = $(".grid-stack").gridstack
    ({
        width:  12,
        height: 9,
        animate: true,
        always_show_resize_handle: /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),
        draggable:
        {
            handle: ".box-title-bar"
        },
        resizable:
        {
            aspectRatio: "true",
            handles: "se"
        }
    }).data("gridstack");

设置resizable:{aspectRatio:“true”}为网格中的所有tile设置它;但是,我无法弄清楚如何只为其中一个磁贴/小部件设置它。

0 个答案:

没有答案