2011-02-08 21 views
0

我遇到了與三列(div元素)同步高度的問題。其中一列是主要內容容器。但是我在主內容容器中有一些動畫,所以我想在動畫期間和之後將高度與其他兩列同步。動畫是CSS 3 webkit轉換動畫。動畫不在列本身中出現,而是在主內容容器的內容中出現。我嘗試過使用表格,並將列的div高度設置爲100%。事情是該列在動畫之後同步。我也嘗試過使用Jquery,但沒有成功,那裏也存在同樣的問題。在動畫狀態下同步div高度

最後我想澄清。我希望他們在動畫期間同步,而不是之後!

任何人都可以提供一個解決方案,而不必一直調用函數,比如syncColumnHeight(); //獲取主內容容器的列高度並將其插入到其他兩列上。

UPDATE: 的HTML代碼表元素開始:

<table> 
    <tr> 
     <td> 
      <div id='leftColumn'></div>//I want this to sync with the height of the mainContentColumn 
     </td> 
     <td> 
      <div id='mainContentColumn'></div>//All the animation is occuring here 
     </td> 
     <td> 
      <div id='rightColumn'></div>//I want this to sync with the height of the mainContentColumn 
     </td> 
    </tr> 
</table> 
+0

你能否提供一些HTML關於所述列?我不完全確定結構是什麼樣子。 – Nightfirecat 2011-02-09 00:40:30

回答

1

這是一個有點困難不看你的CSS來解決,但我猜的div有柱的造型,而TDS是那些需要它的人。

http://jsfiddle.net/duopixel/weG8P/

所以,在代碼:

table td { 
    /*Apply column styles such as background-color here*/ 
    -webkit-transition: all 1s ease; 
}