jquery ui 可调整大小的正确使用

发布于 2024-10-03 05:20:50 字数 710 浏览 0 评论 0原文

在我的网站中,我使用原型,在原型中,您可以将函数作为参数传递给某些对象,例如可拖动对象。

我最近说过使用 jquery resizeable,但我不太清楚如何准确地自定义它的行为。

使用默认选项,我无法执行一些自定义操作,例如动态更改网格大小或设置包含属性。

更具体地说,我希望能够使我的可调整大小的对象保持在 div 的边界内。包含选项效果不佳:看起来它计算的是整个 div 高度,而不仅仅是可调整大小顶部的 div 高度的剩余部分。

如果有人有高级可调整大小定制的示例可供分享,那就太好了。

这是我到目前为止所得到的:

jQuery("#div81").resizable(
{ 
    autoHide: true,
                containment: "#container_div",
                handles: 's',

                start: function(event, ui) {
                    },
                resize: function(event, ui) {
                    },
                stop: function(event, ui) {
                    }

            });

谢谢你的帮助,

塔尔

In my website i use prototype, and in prototype you can pass functions as parameters to some objects, for example, the dragable object.

I have recently stated using jquery resizeable, and i can't quite figure out how exactly to customize it's behavior.

With the default options, i can't do some custom things, like change the grid size dynamicly, or set the containment properties.

To be more specific, i want to be able to make my resizable object stay within the boundaries of a div. the containment option does not work well: it looks like it counts the whole div height, and not just the remainder of the div height from the resizable top.

If someone have an example of advanced resizable customizing to share, it would be great.

here is what i have so far:

jQuery("#div81").resizable(
{ 
    autoHide: true,
                containment: "#container_div",
                handles: 's',

                start: function(event, ui) {
                    },
                resize: function(event, ui) {
                    },
                stop: function(event, ui) {
                    }

            });

thanks for your help,

Tal

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文