높이 맞춤

1670 단어 div
function doResize(divID) {
	    	//store logo    
	    	const appconHeight = 110;
	    	//store    
	    	var shelfOuterHeight = $(window).height()-540<appconHeight?appconHeight:$(window).height()-540;
	    	//     store
	    	var rowsCount = Math.floor(shelfOuterHeight/appconHeight);
	    	//store       
	    	var shelfInnerHeight = appconHeight*rowsCount;
	    	//     
	    	var marginTop = (shelfOuterHeight-shelfInnerHeight)/2;
	    	var shelfSizeStyle = "height: "+shelfInnerHeight+"px;";
	    	shelfSizeStyle += "margin-top: "+marginTop+"px";
	    	 $("#itemStoreShelf").attr("style",shelfSizeStyle);
	    	 $("#container").attr("style","height:"+($(window).height()-118)+"px");
	    	 $("#storeall_con").attr("style","height:"+shelfOuterHeight+"px");
	    }

 
<div id="storeall_con">
        <div class="applist_con" id="appList_con1">
        	<div id="store_list_show" class="list_show">
	            <div id="itemStoreShelf" class="list_show">
	            	<!--   div -->
	            </div>
                </div>
        </div>
</div>

 
<body onload='doResize("appList_con1");' onresize='doResize("appList_con1");'>
 
모든 div에서 Height의 높이를 제거합니다.

좋은 웹페이지 즐겨찾기