JS 구현 페이지 등 높 음

956 단어 js전단
function alignHeight(eleA,eleB,eleC){ //alert(eleA);   if(!document.getElementById(eleA)){return false;}   if(!document.getElementById(eleB)){return false;}   if(!document.getElementById(eleC)){return false;}     var heightA = document.getElementById(eleA).clientHeight;   var heightB = document.getElementById(eleB).clientHeight;   var heightC = document.getElementById(eleC).clientHeight;   var height=new Array(heightA,heightB,heightC);   var a=Math.max.apply(Math,height);   console.log(a);     document.getElementById(eleA).style.height = a + "px";       document.getElementById(eleB).style.height = a + "px";       document.getElementById(eleC).style.height = a + "px"; } window.onload=function h(){ alignHeight("mainBox","subMainBox","sideBox");
}; //js ,
  :Math.max.apply(Math,array);
  :Math.min.apply(Math,array);

좋은 웹페이지 즐겨찾기