[Javascript]
<Span style = "color: rgb (0, 102,102,102 );
Font-size: 14px;
Line-height: 15px;
Background-color: rgb (192,208,246) "> </span> <div class =" wp_syntax "> <div class =" code "> <pre class =" javascript "style =" margin-top: 15px;
Margin-bottom: 15px;
Padding-top: 0px;
Padding-right: 0px;
Padding-bottom: 0px;
Padding-left: 20px;
Font-family: monospace;
Word-wrap: break-word;
Overflow-x: auto;
Border-left-width: 5px;
Border-left-style: solid;
Border-left-color: rgb (0, 221,221,221 );
Font-size: 12px;
Line-height: 21px;
Color: rgb (102,102,102 );
Background-color: rgb (245,245,245) "name =" code "> <span style =" color: rgb (102) "> <strong> var </strong> </span> adjustIframe <span style =" color: rgb (51,153, 51) ">=</span> <span style =" color: rgb (102) "> <strong> function </strong> </span> <span style =" color: rgb (0,153, 0) "> (</span> id <span style =" color: rgb (0,153, 0) ">) </span> <span style =" color: rgb (0,153, 0) ">{</span>
<Span style = "color: rgb (102, 51,153)"> <strong> var </strong> </span> iframe <span style = "color: rgb, 51) ">=</span> document. <span style = "color: rgb (102, 0,153)"> getElementById </span> <span style = "color: rgb (, 0) "> (</span> id <span style =" color: rgb (0,153, 0) ">) </span>
<Span style = "color: rgb (102, 51,153)"> <strong> var </strong> </span> idoc <span style = "color: rgb, 51) ">=</span> iframe. <span style = "color: rgb (102, 51,153)"> contentWindow </span> <span style = "color: rgb (, 51) ">&</span> iframe. <span style = "color: rgb (102,0, 102)"> contentWindow </span>. <span style = "color: rgb (102, 51,153)"> document </span> <span style = "color: rgb (, 51) ">||</span> iframe. <span style = "color: rgb (102, 51,153)"> contentDocument </span> <span style = "color: rgb (, 51)">;
</Span>
<Span style = "color: rgb (102, 51,153)"> <strong> var </strong> </span> callback <span style = "color: rgb, 51) ">=</span> <span style =" color: rgb (102) "> <strong> function </strong> </span> <span style =" color: rgb (0,153, 0) "> (</span> <span style =" color: rgb (0,153, 0) ">) </span> <span style =" color: rgb (0,153, 0) ">{</span>
<Span style = "color: rgb (102, 51,153)"> <strong> var </strong> </span> iheight <span style = "color: rgb, 51) ">=</span> Math. <span style = "color: rgb (102, 0,153)"> max </span> <span style = "color: rgb (, 0) "> (</span> idoc. <span style = "color: rgb (102,0, 102)"> body </span>. <span style = "color: rgb (102, 51,153)"> scrollHeight </span> <span style = "color: rgb (, 51)">, </span> idoc. <span style = "color: rgb (102,0, 102)"> documentElement </span>. <span style = "color: rgb (102, 0,153)"> scrollHeight </span> <span style = "color: rgb (, 0)">) </span> <span style = "color: rgb (51,153, 51)">;
</Span> <span style = "color: rgb (0,102, 0)"> <em>
// Obtain its height </em> </span>
Iframe. <span style = "color: rgb (102,0, 102)"> style </span>. <span style = "color: rgb (102, 51,153)"> height </span> <span style = "color: rgb (, 51) ">=</span> iheight <span style =" color: rgb (51,153, 51) "> + </span> <span style =" color: rgb (51,102,204) ">" px "</span> <span style =" color: rgb (51,153, 51) ">;
</Span>
<Span style = "color: rgb (0,153, 0)" >}</span>
<Span style = "color: rgb (102, 0,153)"> <strong> if </strong> </span> <span style = "color: rgb (, 0) "> (</span> iframe. <span style = "color: rgb (102, 0,153)"> attachEvent </span> <span style = "color: rgb (, 0)">) </span> <span style = "color: rgb (0,153, 0)">
{</Span>
Iframe. <span style = "color: rgb (102, 0,153)"> attachEvent </span> <span style = "color: rgb (, 0) "> (</span> <span style =" color: rgb (51,102,204) ">" onload "</span> <span style =" color: rgb (51,153, 51) ">,</span> callback <span style =" color: rgb (0,153, 0) ">) </span> <span style =" color: rgb (51,153, 51) ">;
</Span>
<Span style = "color: rgb (0,153, 0)" >}</span> <span style = "color: rgb (102) "> <strong> else </strong> </span> <span style =" color: rgb (0,153, 0) ">{</span>
Iframe. <span style = "color: rgb (102, 51,153)"> onload </span> <span style = "color: rgb (, 51) ">=</span> callback
<Span style = "color: rgb (0,153, 0)" >}</span>
<Span style = "color: rgb (0,153, 0)" >}</span> </pre> <div> <span style = "color: rgb (0,153, 0) "> <br> </span> </div> <p style =" margin-top: 15px;
Margin-bottom: 15px;
Padding-top: 0px;
Padding-bottom: 0px;
Line-height: 25px;
Color: rgb (1, 102,102,102) "> <span id =" more-664 "> </span> </p> <div class =" post-top "style =" background-color: initial;
Padding-left: 115px "> </div>
[Javascript]
<Span style = "background-color: rgb (192,208,246)"> </span> <span style = "color: rgb (102,102,102 );
Font-size: 14px;
Line-height: 15px;
Background-color: rgb (192,208,246) "> the HTML code is as follows: </span> <p style =" margin-top: 15px;
Margin-bottom: 15px;
Padding-top: 0px;
Padding-bottom: 0px;
Line-height: 25px;
Color: rgb (1, 102,102,102) "> </p> <div class =" wp_syntax "> <div class =" code "> <pre class =" html "style =" margin-top: 15px;
Margin-bottom: 15px;
Padding-top: 0px;
Padding-right: 0px;
Padding-bottom: 0px;
Padding-left: 20px;
Font-family: monospace;
Word-wrap: break-word;
Overflow-x: auto;
Border-left-width: 5px;
Border-left-style: solid;
Border-left-color: rgb (0, 221,221,221 );
Font-size: 12px;
Line-height: 21px;
Color: rgb (1, 102,102,102) "name =" code "> <iframe id =" js_sub_web "width =" 80% "frameborder =" 0 "scrolling =" no "allowTransparency =" true "src =" http://www.cnblogs.com/rubylouvre/archive/2009/09/15/1566722.html ">
</Iframe> </pre> </div> <p style = "margin-top: 15px;
Margin-bottom: 15px;
Padding-top: 0px;
Padding-bottom: 0px;
Line-height: 25px;
Color: rgb (102,102,102) "> use code: </p> <div class = "wp_syntax"> <div class = "code"> <pre class = "javascript" style = "margin-top: 15px;
Margin-bottom: 15px;
Padding-top: 0px; padding-right: 0px;
Padding-bottom: 0px; padding-left: 20px;
Font-family: monospace;
Word-wrap: break-word;
Overflow-x: auto;
Border-left-width: 5px;
Border-left-style: solid;
Border-left-color: rgb (0, 221,221,221 );
Font-size: 12px; line-height: 21px;
Color: rgb (102,102,102 );
Background-color: rgb (245,245,245) "name =" code "> window. <span style = "color: rgb (102, 51,153)"> onload </span> <span style = "color: rgb (, 51) ">=</span> <span style =" color: rgb (102) "> <strong> function </strong> </span> <span style =" color: rgb (0,153, 0) "> (</span> <span style =" color: rgb (0,153, 0) ">) </span> <span style =" color: rgb (0,153, 0) ">{</span>
AdjustIframe <span style = "color: rgb (0,153, 0)"> (</span> <span style = "color: rgb (51,102,204) ">" js_sub_web "</span> <span style =" color: rgb (0,153, 0) ">) </span> <span style =" color: rgb (51,153, 51) ">;</span>
<Span style = "color: rgb (0,153, 0) ">}</span> </pre> </div> <div class =" wp_syntax "> <div class =" code "> <pre class =" javascript "style =" margin-top: 15px;
Margin-bottom: 15px;
Padding-top: 0px;
Padding-right: 0px;
Padding-bottom: 0px;
Padding-left: 20px;
Word-wrap: break-word;
Overflow-x: auto; border-left-width: 5px;
Border-left-style: solid; border-left-color: rgb (0, 221,221,221) "name =" code "> </pre> </div> <span style =" color: #666666 "> <span style =" line-height: 21px "> </span>
From Zhang Yi ☆. Net★Java software alliance