JavaScript Jquery各种代码片段
[javascript]
<span style="color:rgb(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(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(0,51,102)"><strong>var</strong></span> adjustIframe <span style="color:rgb(51,153,51)">=</span> <span style="color:rgb(0,51,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(0,51,102)"><strong>var</strong></span> iframe <span style="color:rgb(51,153,51)">=</span> document.<span style="color:rgb(102,0,102)">getElementById</span><span style="color:rgb(0,153,0)">(</span>id<span style="color:rgb(0,153,0)">)</span>
<span style="color:rgb(0,51,102)"><strong>var</strong></span> idoc <span style="color:rgb(51,153,51)">=</span> iframe.<span style="color:rgb(102,0,102)">contentWindow</span> <span style="color:rgb(51,153,51)">&&</span> iframe.<span style="color:rgb(102,0,102)">contentWindow</span>.<span style="color:rgb(102,0,102)">document</span> <span style="color:rgb(51,153,51)">||</span> iframe.<span style="color:rgb(102,0,102)">contentDocument</span><span style="color:rgb(51,153,51)">;
</span>
<span style="color:rgb(0,51,102)"><strong>var</strong></span> callback <span style="color:rgb(51,153,51)">=</span> <span style="color:rgb(0,51,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(0,51,102)"><strong>var</strong></span> iheight <span style="color:rgb(51,153,51)">=</span> Math.<span style="color:rgb(102,0,102)">max</span><span style="color:rgb(0,153,0)">(</span>idoc.<span style="color:rgb(102,0,102)">body</span>.<span style="color:rgb(102,0,102)">scrollHeight</span><span style="color:rgb(51,153,51)">,</span> idoc.<span style="color:rgb(102,0,102)">documentElement</span>.<span style="color:rgb(102,0,102)">scrollHeight</span><span style="color:rgb(0,153,0)">)</span><span style="color:rgb(51,153,51)">;
</span> <span style="color:rgb(0,102,0)"><em>
//取得其高</em></span>
iframe.<span style="color:rgb(102,0,102)">style</span>.<span style="color:rgb(102,0,102)">height</span> <span style="color:rgb(51,153,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(0,0,102)"><strong>if</strong></span> <span style="color:rgb(0,153,0)">(</span>iframe.<span style="color:rgb(102,0,102)">attachEvent</span><span style="color:rgb(0,153,0)">)</span> <span style="color:rgb(0,153,0)">
{</span>
iframe.<span style="color:rgb(102,0,102)">attachEvent</span><span style="color:rgb(0,153,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(0,0,102)"><strong>else</strong></span> <span style="color:rgb(0,153,0)">{</span>
iframe.<span style="color:rgb(0,0,102)">onload</span> <span style="color:rgb(51,153,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></div></div><p style="margin-top:15px;
margin-bottom:15px;
padding-top:0px;
padding-bottom:0px;
line-height:25px;
color:rgb(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)">HTML代码如下所示:</span><p style="margin-top:15px;
margin-bottom:15px;
padding-top:0px;
padding-bottom:0px;
line-height:25px;
color:rgb(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(221,221,221);
font-size:12px;
line-height:21px;
color:rgb(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></div><p style="margin-top:15px;
margin-bottom:15px;
padding-top:0px;
padding-bottom:0px;
line-height:25px;
color:rgb(102,102,102)">使用代码:</p><div class=&q
补充:web前端 , JavaScript ,