The div corresponding to the IFRAME:
<DivID= "Iframezone"> <iframeID= "iframe"frameborder= ' 0 'scrolling= ' No 'Height= "0"width= "0"onload= "autoheight ();"></iframe> </Div>
< Li > < data-toggle= "tab" href= "javascript:void (0)" onclick = "Iframeaddsrc ('/customer/smsrecord ', this)"></a> </ Li >
Click Load page to iframe. The corresponding JS:
//The IFRAME is adaptive High, onload will trigger when the IFRAME is not loaded, so add settimeout to prevent the adaptive height from appearing to zerofunctionautoheight () {setTimeout (function () { variframe = document.getElementById ("iframe"); if(IFRAME. Document) {//ie own PropertiesIframe.style.height =iframe. Document.documentElement.scrollHeight; } Else if(iframe.contentdocument) {//Ie,firefox,chrome,opera,safariIframe.height = Screen.availheight;//$ (IFRAME). Contents (). Find ("body"). Height () +;Iframe.width = "100%";//screen.availwidth * 0.97-216.4; } }, 1);}functioniframeaddsrc (src, obj) {$.post ("/home/validatestatus"). Done (function(data) {if(data = = Undefined | | data = =NULL|| Data.status! = "OK") { return; } $(". Tabactive"). Removeclass ("Tabactive")); $ (obj). addclass ("Tabactive"); SRC= src + (src.indexof ('? ') > 0? "&r": "? r") + "=" +Math.random (); $("#iframe"). Removeattr ("src")); $("#iframe"). attr ("src"), SRC); if($ ("#iframe"). OnLoad) $ ("#iframe"). onload (); });}
Front End Summary (5)----IFRAME