aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/visualviewport/offsettop/index.html
blob: 35202bd69ea81fc25b75211d8770a7e21d0c0e76 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
---
title: VisualViewport.offsetTop
slug: Web/API/VisualViewport/offsetTop
tags:
  - API
  - offsetTop
translation_of: Web/API/VisualViewport/offsetTop
---
<p>{{SeeCompatTable}}{{APIRef("Visual Viewport")}}</p>

<p>{{domxref("VisualViewport")}} 接口的只读属性 <strong><code>offsetTop</code></strong> 返回视觉视口的顶部相对于布局视口的顶部的偏移量,以CSS像素为单位。</p>

<h2 id="语法">语法</h2>

<pre class="syntaxbox">var <em>offsetTop</em> = VisualViewport.offsetTop</pre>

<h3 id="值"></h3>

<p>一个双精度值。</p>

<h2 id="定义">定义</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
  <tr>
   <td>{{SpecName('Visual Viewport','#dom-visualviewport-offsettop','offsetTop')}}</td>
   <td>{{Spec2('Visual Viewport')}}</td>
   <td>Initial definition.</td>
  </tr>
 </tbody>
</table>

<h2 id="浏览器兼容性">浏览器兼容性</h2>



<p>{{Compat("api.VisualViewport.offsetTop")}}</p>