ITeye博客

JS窗口改变触发事件

duyunfengsolo · 2011-04-28 17:32 · JavaScript · 编程语言 · Markdown

                var  resizeTimer = null;
	function doResize(){
		var url = '${ctx}/aa/monitor/alar/recharge.jsp';
		window.location.href = url;
	    //alert("width="+document.documentElement.clientWidth + "   Height="+document.documentElement.clientHeight);
	}
	window.onresize = function(){
	   if(resizeTimer) clearTimeout(resizeTimer);
	  resizeTimer = setTimeout("doResize()",0);
                }

 

window.onresize = function()
	{
		var url = '${ctx}/bomc3/monitor/alar/recharge.jsp';
		window.location.href = url;
	};

 

另外获取宽高:

document.documentElement.clientWidth

parent.document.body.clientWidth

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。