客戶端正在使用內容管理系統將文本注入到代表按鈕的2個div中。我希望按鈕的高度相等。問題是:要求在頁面加載時將div設置爲其高度的最大值
- 如果我一套等於兩個使用
CSS
的高度,那麼,只有當客戶端不輸入太多的文字作品。 - 如果我沒有使用
CSS
設置高度,那麼只有當客戶端在兩個文本中輸入相同行數的文本時才起作用。
所以我認爲JQuery將在這一個來救援。你能幫我弄清楚使用哪些函數嗎?
問題的概要是:
<div id="button1">
<p>Here's some text that the client will control.</p>
</div>
<div id="button2">
<p>Here's some more text that the client will control</p>
</div>
<script type="text/javascript">
/* Here will go some JS to make button1 and button2 the height of whichever one is taller when the page has loaded the client's text that the CMS injected */
</script>
作爲jQuery選項,看看:http://tsvensen.github.io/equalize.js/ – 2014-09-23 22:16:56