客户端正在使用内容管理系统将文本注入到代表按钮的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