js 获取iframe内容的高度 并动态设置iframe的高度

http://abc08010051.iteye.com/blog/1840204

博客分类: 
 
var frame = document.getElementById('#frame'),      win = frame.contentWindow,      doc = win.document,      html = doc.documentElement,      body = doc.body; 
// 获取高度  var height = Math.max( body.scrollHeight, body.offsetHeight,                         html.clientHeight, html.scrollHeight, html.offsetHeight ); 
frame.setAttribute('height', height);