PHP建站时DIV竖向不对齐导致网站不美观,邢台网站建设公司重宇科技为你提供DIV对齐代码
返回

PHP建站时DIV竖向不对齐导致网站不美观,邢台网站建设公司重宇科技为你提供DIV对齐代码

时间:2013-1-27  编辑:邢台网络公司
  PHP建站时DIV竖向不对齐导致网站不美观,邢台网站建设公司重宇科技为你提供DIV对齐代码。转载请加入 邢台网络公司重宇网络www.tianyv.net

========================================================================================================

<SCRIPT type=text/javascript>
<?php for($i=1;$i<10;$i++){?>
function P<? echo $i?>_colH(){ //v1.5 by PVII-www.projectseven.com
var i,oh,hh,h=0,dA=document.p<? echo $i?>eqc,an=document.p<? echo $i?>eqa;if(dA&&dA.length){
for(i=0;i<dA.length;i++){dA[i].style.height='auto';}for(i=0;i<dA.length;i++){
oh=dA[i].offsetHeight;h=(oh>h)?oh:h;}for(i=0;i<dA.length;i++){if(an){
dA[i].style.height=h+'px';}else{P<? echo $i?>_eqA(dA[i].id,dA[i].offsetHeight,h);}}if(an){
for(i=0;i<dA.length;i++){hh=dA[i].offsetHeight;if(hh>h){
dA[i].style.height=(h-(hh-h))+'px';}}}else{document.p<? echo $i?>eqa=1;}
document.p<? echo $i?>eqth=document.body.offsetHeight;
document.p<? echo $i?>eqtw=document.body.offsetWidth;}
}
function P<? echo $i?>_eqT(){ //v1.5 by PVII-www.projectseven.com
if(document.p<? echo $i?>eqth!=document.body.offsetHeight||document.p<? echo $i?>eqtw!=document.body.offsetWidth){
P<? echo $i?>_colH();}
}
function P<? echo $i?>_equalCols(){ //v1.5 by PVII-www.projectseven.com
if(document.getElementById){document.p<? echo $i?>eqc=new Array;for(i=0;i<arguments.length;i++){
document.p<? echo $i?>eqc[i]=document.getElementById(arguments[i]);}setInterval("P<? echo $i?>_eqT()",10);}
}
function P<? echo $i?>_eqA(el,h,ht){ //v1.5 by PVII-www.projectseven.com
var sp=10,inc=10,nh=h,g=document.getElementById(el),oh=g.offsetHeight,ch=parseInt(g.style.height);
ch=(ch)?ch:h;var ad=oh-ch,adT=ht-ad;nh+=inc;nh=(nh>adT)?adT:nh;g.style.height=nh+'px';
oh=g.offsetHeight;if(oh>ht){nh=(ht-(oh-ht));g.style.height=nh+'px';}
if(nh<adT){setTimeout("P<? echo $i?>_eqA('"+el+"',"+nh+","+ht+")",sp);}
}
/////////////////////////////////////////////////////------P<? echo $i?>_colH-------->>>
<? }?>
</SCRIPT>

<<12>>>
回顶部
分享到: