2011-02-08 50 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; 
}