【发布时间】:2018-02-07 09:51:36
【问题描述】:
问题来了:
我们可以让窗口根据内容调整大小,但是当窗口调整大小时,高度不会动态变化,要么在下方留下大量空白,要么将内容隐藏在页面的其余部分后面。
代码如下:
HTML:
<div class="panel-container" style="height: 706px;">
<div class="control-panel create-job flexible">
<div class="column-container">
JSX:
resizePanel: function (height) {
this.refs.panel.style.height = height + 'px';
},
getPanelContainerStyle: function (controlPanel) {
if (this.state.isPanelOpen && _.isObject(controlPanel)) {
var height = controlPanel.type.prototype.height;
if (_.isNumber(height)) {
return {height: height};
} else return {height: 100};
} else return {};
},
CSS:
.panel-container
height 0
transition height 0.3s
margin-top bump-lg px
margin-bottom bump-lg px
非常感谢任何帮助!
【问题讨论】:
标签: javascript jquery html css