1. 程式人生 > >easyUI Layout自適應視窗大小

easyUI Layout自適應視窗大小

</pre><p>關於頁面自適應效果</p><p><pre name="code" class="javascript">
//監聽視窗大小變化
	window.onresize = function(){
		setTimeout(redraw,300);
	};
	//改變表格寬高
	//自動調整
		function redraw(){
			var win_width = $("#content").width();
			$('#content').layout('panel', 'west').panel('resize',{width:win_width/3});
			$('#content').layout('panel', 'center').panel('resize',{width:win_width/3});
			$('#content').layout('panel', 'east').panel('resize',{width:win_width/3});
			$('#content').layout('resize');
		}