首頁 > web前端 > js教程 > JavaScript Jquery各種程式碼片段

JavaScript Jquery各種程式碼片段

高洛峰
發布: 2016-11-26 11:25:22
原創
932 人瀏覽過

[javascript]

margin-bottom:15px;<br/>padding-top:0px; <br/>padding-right:0px; <br/>padding-bottom:0px;<br/>padding-left:20px;<br/>font-family:monospace;<br/>word-wrap:break-word;<br/>overflow-x:auto;<br/>border-left-width :5px; :solid;<br/>左邊框顏色:rgb(221,221,221);<br/>字體大小:12px;<br/>行高:21px;<br/>顏色:rgb(102,102,102);<br/>背景顏色:rnameb">2455 style="color:rgb(0,51,102)"><strong>var</strong></span> adjustmentIframe <span style="color:rgb(51,153,51)">=</span>; <span style ="color:rgb(0,51,102)"><strong>函數</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> <br/>    <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樣式=「顏色:rgb(0,153,0)」>)</span> <br/>   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)">文檔</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)">;<br/></span> <br/>   style="color:rgb(0,51,102)"><strong>var</strong></span>回呼<span style="color:rgb(51,153,51)">=</span>; <span style ="color:rgb(0,51,102)"><strong>函數</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> <br/>        <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="顏色: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) )">;<br/></span> <span style="color:rgb(0,102,0)"><em><br/>//取得其高< /em></span> <br/>        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)">;<br/></span> <br/>    <span style="color:rgb(0,153,0)">}</span> <br/>    <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)"><br/>{</span> <br/>        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)">;<br/></span> <br/>    <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> <br/>        iframe.<span style="color:rgb(0,0,102)">onload</span> <span style="color:rgb(51,153,51)">=</span> callback <br/>    <span style="color:rgb(0,153,0)">}</span> <br/><span style="color:rgb(0,153,0)">}</span>


[javascript]
HTML代码如下所示:

margin-bottom:15px;
 padding-top:0px;
 padding-bottom:0px;
 line-height:25px;
color:0px;
 line-height:25px;
color:使用程式碼:

登入後複製
< div class="wp_syntax">< ;div class="code">
margin-bottom:15px;<br/>padding-top:0px;<br/>padding-right :0px;<br/>padding-底部:0px;<br/>padding-left:20px;<br/>word-wrap:break-word;<br/>overflow-x:auto; border-left-width:5px;<br/>border-left-style:solid; rgb(221,221,221)" name="code">
登入後複製
 

相關標籤:
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
最新問題
javascript - vue+webpack怎麼引入jquery
來自於 1970-01-01 08:00:00
0
0
0
javascript - webpack 安裝jQuery報錯
來自於 1970-01-01 08:00:00
0
0
0
javascript - 怎麼能import部分jquery的方法?
來自於 1970-01-01 08:00:00
0
0
0
javascript - jQuery引用出錯
來自於 1970-01-01 08:00:00
0
0
0
熱門推薦
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板