iframe auto set height

Parent page:
document.domain = 'xxxx.com'
function fixIframeHeight(h,iframe){
    $(iframe).height(h);
}



Iframe page:

document.domain = 'xxxx.com'
console.log('reset header iframe height!!');
window.onload = function(){
parent.fixIframeHeight(document.documentElement.scrollHeight,'#headeriframe');
}
window.onresize = function(){
parent.fixIframeHeight(document.documentElement.scrollHeight,'#headeriframe');
}

posted on 2015-02-02 12:34  lzf0514  阅读(254)  评论(0编辑  收藏  举报

导航