用settimeout,在dom加载后执行方法

来源:互联网 发布:淘宝立体3d服装制作 编辑:程序博客网 时间:2024/05/17 20:29

方法如下:

setTimeout(function(){var birtRoot = document.getElementById('__BIRT_ROOT');if(birtRoot){birtRootHeight = birtRoot.offsetHeight;if(birtRootHeight>0){documentViewHeightChange();return;}return;}setTimeout(arguments.callee,100);},100)

网上没有搜到自己写了下,没有优化代码,就这样吧。