我正在寻找的是让我的容器在点击时调整大小。
容器内有 2 个以不同高度向下滑动的面板。我需要容器来监听切换功能并在需要时调整大小。
这是到目前为止的代码......
$(document).ready(function() {
var content = $("#content_container");
var childHeight = $('.panel-container').height();
if (content < childHeight) {
$(content).css("height", 657 + "px");
}
else {
$(content).css("height", "auto");
}
});
PS。我是 jQuery 的新手!!