當(dāng)前位置:
首頁(yè) >
前端技术
> javascript
>内容正文
javascript
JS实现一行内多列DIV同高
生活随笔
收集整理的這篇文章主要介紹了
JS实现一行内多列DIV同高
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
JS實(shí)現(xiàn)一行內(nèi)多列DIV同高 代碼 <script?language="javascript"?type="text/javascript">
????<!--
????????window.onload=window.onresize=function()
????????{
????????????if(document.getElementById('RDiv').clientHeight<document.getElementById('LDiv').clientHeight)
????????????{
????????????????document.getElementById('RDiv').style.height=document.getElementById('LDiv').offsetHeight+"px";
????????????}
????????????else
????????????{
????????????????document.getElementById('LDiv').style.height=document.getElementById('RDiv').offsetHeight+"px";
????????????}
????????}
????-->
</script>
<div?id="LDiv"?style="?float:left;?width:150px;?background-color:?#E6E6E6;">
</div>
<div?id="RDiv"?style="?float:left;?background-color:?#E9F4FF;">
</div>?
????<!--
????????window.onload=window.onresize=function()
????????{
????????????if(document.getElementById('RDiv').clientHeight<document.getElementById('LDiv').clientHeight)
????????????{
????????????????document.getElementById('RDiv').style.height=document.getElementById('LDiv').offsetHeight+"px";
????????????}
????????????else
????????????{
????????????????document.getElementById('LDiv').style.height=document.getElementById('RDiv').offsetHeight+"px";
????????????}
????????}
????-->
</script>
<div?id="LDiv"?style="?float:left;?width:150px;?background-color:?#E6E6E6;">
</div>
<div?id="RDiv"?style="?float:left;?background-color:?#E9F4FF;">
</div>?
?
posted on 2010-01-25 21:55 ms_dos 閱讀(...) 評(píng)論(...) 編輯 收藏轉(zhuǎn)載于:https://www.cnblogs.com/nine425/archive/2010/01/25/1656236.html
總結(jié)
以上是生活随笔為你收集整理的JS实现一行内多列DIV同高的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: ASP.NET MVC 2
- 下一篇: ldd,locate,vimdiff