最近在使用highchart
和bootstrap
的時候,出現了問題,當我使用bootstrap
的Tab
組件時,highchart
在渲染的時候其容器的大小無法自適應其中隱藏的Tab
下的容器(注:Tab
下容器大爲動態的),切換Tab
時容器的大小不是我想要的,當我移動瀏覽器界面或者改變瀏覽器界面大小時,其纔會顯示在我正真容器大小裏面(感覺自己說的好囉嗦),那麼怎麼讓其自適應其隱藏的容器大小呢,下面是我用CSS
處理這個問題,代碼如下:
/* bootstrap hack: fix content width inside hidden tabs */
.tab-content > .tab-pane:not(.active),
.pill-content > .pill-pane:not(.active) {
display: block !important;
height: 0 !important;
overflow-y: hidden !important;
overflow-x: hidden !important;
}
/* bootstrap hack end */
看了網友的貢獻,然後寫下來,希望幫到有需要的前端程序猿……