一、easyui combotree下拉面板宽度自适应:
$('#checkitems').combotree({
panelWidth: 'auto',//宽度自适应
onShowPanel:function(){//面板自适应
$(this).combobox('panel').width("auto");
}
});
二、easyui combotree下拉面板高自适应:
$('#checkitems').combotree({
panelHeight: 'auto', //高度自适应
});
三、easyui combotree下拉面设置固定高度:
$('#checkitems').combotree({
panelMaxHeight: 150, // 设置需要固定的高度(适用于1.4或以上版本)。
});
四、宽度自适应,设置最新宽度和最大宽度
$('#QueryJcxm').combotree({
panelWidth: 'auto',//宽度自适应
panelMaxHeight: 150, // 设置需要固定的高度(适用于1.4或以上版本)。
onShowPanel: function () {//面板自适应
$(this).combobox('panel').width("auto");
//宽度超过500则显示500,最小宽度显示和下拉框的宽度一致
var width = $(this).combobox('panel').width();
if (width > 500) {
$(this).combobox('panel').width("500");
} else if (width < 200) {
$(this).combobox('panel').width("200");
} else {//解决在IE下出现滚动条的问题
$(this).combobox('panel').width(width + 20);
}
}
})
五、参照网址:
宽度自适应:https://blog.csdn.net/tyjlearning/article/details/79162677
高度自适应:https://blog.csdn.net/ye11ye/article/details/78853439
---------------------
作者:书剑零落
来源:CSDN
原文:https://blog.csdn.net/shunhua19881987/article/details/84940955
版权声明:本文为博主原创文章,转载请附上博文链接!