0

如何在 Jquery EasyUI Panel:Region:west 或 region:center resize 中捕获事件?在用户重新调整中心或东部区域的大小后,我需要刷新一些内容。

<div id="cc" class="easyui-panel" title="Nested Panel" style="height:200px;padding:10px;">
    <div class="easyui-layout" data-options="fit:true">
        <div id="dd" data-options="region:'west',split:true" style="width:100px;padding:10px">
            Left Content
        </div>
        <div id="ee" data-options="region:'center'" style="padding:10px">
            Right Content
        </div>
    </div>
</div>

如何在上面的示例中捕获 Div dd 或 ee ?以下代码也仅适用于首次加载。调整 div dd 或 ee 大小时不起作用

<script>
$(document).ready(function () {
    $(function(){
        $('#cc').panel();
        $('#cc').panel({
            onResize:function(){
                alert("dd");
            }
        });
    });
});
</script>
4

2 回答 2

1

如果您仍在寻找答案,以下代码允许我保存和恢复 easyUI 布局面板的大小:

$(document).ready(function() {
    var panel = $('#main-layout').layout('panel', 'south'),
        hsize = localStorage.getItem('SouthPanel_h');

    panel.panel({
        height: hsize > 0 ? hsize : 50,
        onResize: function(height,width) {
            localStorage.setItem('SouthPanel_h', height);
        }
    });
});
于 2016-02-29T17:11:30.860 回答
0

jQuery 没有这样的事件。你可以试试这个。

http://benalman.com/projects/jquery-resize-plugin

于 2013-04-01T08:20:29.457 回答