简体   繁体   English

jQuery UI-我想检查是否在可调整大小的div上触发了调整大小事件

[英]jQuery UI - I want to check if a resize event was triggered on a resizable div

I have two divs $('.list') and $('.content') side by side. 我有两个divs $('。list')和$('。content')并排。 $('.list') is resizable using jQuery UI resizable and $('.content') is bound to the alsoResize. $('。list')可使用jQuery UI可调整大小来调整大小,而$('。content')可绑定到AlsoResize。

The problem I am having is I need to know when the resizable event is triggered. 我遇到的问题是我需要知道何时可调整大小事件被触发。 .bind('change') or .bind('resize') don't work because resize is only for the window/frame and 'change' seems to be an IE only event. .bind('change')或.bind('resize')无效,因为resize仅适用于窗口/框架,而'change'似乎仅是IE事件。

The solution I had in mind was to actively 'watch' for any changes to the width of the $('.list') div and trigger an event but I'm not sure how to go about doing this. 我想到的解决方案是主动“监视” $('。list')div宽度的任何变化并触发事件,但是我不确定如何执行此操作。

What I can't do is put this inside the resize event because it has to live inside an independent jQuery plugin. 我不能将其放在resize事件中,因为它必须存在于独立的jQuery插件中。 I want the jQuery plugin to watch for any changes. 我希望jQuery插件注意任何更改。

Thanks! 谢谢!

I am not very sure but did you try this. 我不太确定,但您尝试过此方法。 I found it in the documentations in the jquery ui website: 我在jquery ui网站的文档中找到了它:

$( ".selector" ).resizable({     resize: function(event, ui) { ... }   });

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM