Copy codeThe Code is as follows: function SetIFrameHeight (down ){
Var Sys = {};
Var ua = navigator. userAgent. toLowerCase ();
Var s;
(S = ua. match (/msie ([\ d.] + )/))? Sys. ie = s [1]:
(S = ua. match (/firefox \/([\ d.] + )/))? Sys. firefox = s [1]:
(S = ua. match (/chrome \/([\ d.] + )/))? Sys. chrome = s [1]:
(S = ua. match (/opera. ([\ d.] + )/))? Sys. opera = s [1]:
(S = ua. match (/version \/([\ d.] +). * safari /))? Sys. safari = s [1]: 0;
Var pTar = null;
If (document. getElementById ){
PTar = document. getElementById (down );
} Else {
Eval ('ptar = '+ down + ';');
}
PTar. style. display = "block ";
If (Sys. ie ){
If (Sys. ie = '9. 0 '){
PTar. height = ptar.content20.doc ument. body. offsetHeight + 15 + "px ";
PTar. width = ptar.content20.doc ument. body. scrollWidth + "px ";
} Else if (Sys. ie = '8. 0 '){
Debugger;
PTar. height = pTar. Document. body. offsetHeight + 15 + "px ";
PTar. width = pTar. Document. body. scrollWidth + "px ";
} Else {
PTar. height = pTar. Document. body. scrollHeight + 25 + "px ";
PTar. width = pTar. Document. body. scrollWidth + "px ";
}
}
If (Sys. firefox ){
PTar. height = pTar. contentDocument. body. offsetHeight + 15 + "px ";
PTar. width = pTar. contentDocument. body. scrollWidth + "px ";
}
If (Sys. chrome ){
PTar. height = pTar. contentDocument. body. offsetHeight;
PTar. width = pTar. contentDocument. body. scrollWidth;
}
If (Sys. opera ){
PTar. height = pTar. contentDocument. body. offsetHeight;
PTar. width = pTar. contentDocument. body. scrollWidth;
}
If (Sys. safari ){
If (pTar. contentDocument. body. offsetHeight <= '000000 '){
PTar. height = pTar. contentDocument. body. offsetHeight + 10;
} Else {
PTar. height = pTar. contentDocument. body. offsetHeight;
}
PTar. width = pTar. contentDocument. body. scrollWidth;
}
}