Here we provide an iframe adaptive height Code provided by jquery that is compatible with the iframe adaptive height of multiple browsers.
Jquery providesIframe adaptive heightThe code is compatible with the iframe adaptive height of multiple browsers.
JqueryIframeAdaptive height code 1
$ ("# Ipersonalinfo"). load (function (){
$ (This). height ($ (this). contents (). height ());
})
Iframe adaptive height
<Script type = "text/Webpage effects">
// Iframe adaptive height
Function setcwinheight (){
Var bobo = document. getelementbyid ("main"); // iframe id
If (document. getelementbyid ){
If (bobo &&! Window. opera ){
If (bobo. contentdocument & bobo. contentdocument. body. offsetheight ){
Bobo. height = bobo. contentdocument. body. offsetheight;
} Else if(bobo.doc ument & bobo.doc ument. body. scrollheight ){
Bobo. height = bobo.doc ument. body. scrollheight + 30;
// Alert (document. getelementbyid ("amdright"). style. width );
}
}
}
}
</Script>
<Iframe id = "main" name = "main" src = "main. php tutorial "scrolling =" no "width =" 100% "frameborder =" 0 'onload = "setcwinheight ()"> </iframe>
Method 2
<Script type = "text/javascript">
Function resizecontent ()
{
Vertex (window.parent.doc ument). find ("# if1"). height ($ ("# content"). height ());
}
Function show400 ()
{
If ($ ("# test400" ).css tutorial ("display") = "none ")
{
$ ("# Test400" ).css ("display ","");
Resizecontent ();
}
Else
{
$ ("# Test400" ).css ("display", "none ");
Resizecontent ();
}
}
$ (Document). ready (function (){
Resizecontent ();
})
</Script>