diff options
Diffstat (limited to 'files/zh-tw/web/api/element/clientheight/index.html')
-rw-r--r-- | files/zh-tw/web/api/element/clientheight/index.html | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/files/zh-tw/web/api/element/clientheight/index.html b/files/zh-tw/web/api/element/clientheight/index.html new file mode 100644 index 0000000000..99ae4faf06 --- /dev/null +++ b/files/zh-tw/web/api/element/clientheight/index.html @@ -0,0 +1,62 @@ +--- +title: Element.clientHeight +slug: Web/API/Element/clientHeight +tags: + - API + - Reference +translation_of: Web/API/Element/clientHeight +--- +<p>{{ APIRef("DOM") }}</p> + +<p><code><strong>Element.clientHeight </strong></code>唯讀屬性會回傳元素內部高度(像素),包含 padding 但並未包含水平滾動條、border、margin。</p> + +<p><code>clientHeight</code> 可以被計算成 CSS <code>height</code> + CSS <code>padding</code> - 水平滾動條的高度(如果有顯示)</p> + +<div class="note"> +<p><strong>Note:</strong> 這個屬性會以四捨五入進位取整數. 如果要使用非整數值, 使用 {{ domxref("element.getBoundingClientRect()") }}.</p> +</div> + +<h2 id="Syntax_and_values" name="Syntax_and_values">表達式</h2> + +<pre class="syntaxbox">var <var>h</var> = <var>element</var>.clientHeight;</pre> + +<p><code><var>h</var></code> 代表元素高度(pixels)的正整數.</p> + +<h2 id="Example" name="Example">範例</h2> + +<p> </p> + +<p> <img alt="Image:Dimensions-client.png" class="internal" src="/@api/deki/files/185/=Dimensions-client.png"></p> + + +<h2 id="Specification" name="Specification">規範</h2> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">規範</th> + <th scope="col">狀態</th> + <th scope="col">註</th> + </tr> + </thead> + <tbody> + <tr> + <td>{{SpecName('CSSOM View', '#dom-element-clientheight', 'clientHeight')}}</td> + <td>{{Spec2('CSSOM View')}}</td> + <td> </td> + </tr> + </tbody> +</table> + +<h3 id="Notes" name="Notes">註</h3> + +<p><code>clientHeight</code> 是在 the Internet Explorer 物件介紹的屬性.</p> + +<h2 id="See_Also" name="See_Also">參見</h2> + +<ul> + <li>{{domxref("HTMLElement.offsetHeight")}}</li> + <li>{{domxref("Element.scrollHeight")}}</li> + <li><a href="/en-US/docs/Determining_the_dimensions_of_elements">Determining the dimensions of elements</a></li> + <li><a href="https://docs.microsoft.com/en-us/previous-versions//hh781509(v=vs.85)">MSDN Measuring Element Dimension and Location</a></li> +</ul> |