簡體   English   中英

Bootstrap 自動高度面板

[英]Bootstrap Auto Height Panels

我有 3 個面板(見圖) 面板視圖

Panel1的高度根據內容改變高度。 Panel2具有固定高度。 我的問題:我想要Panel3一個“完美”的高度,比如height = panel1.height - panel2.height

但我不知道我該怎么做。

試試這樣的——

使用 JavaScript

var panel1Height = document.getElementById('panel1').clientHeight;
var panel2Height = '20';
var panel3Height = panel1Height - panel2Height;
document.getElementById("panel3").style.height= panel3Height + 'px';

請注意,這只是一個模型,根據您的需要對其進行自定義。

這個框架在行height完成工作......並且如果你放置動態內容總是自我調整

框架: https : //github.com/mattbanks/jQuery.equalHeights代碼: https : //codepen.io/micahgodbolt/pen/FgqLc

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM