--- title: VisualViewport.offsetTop slug: Web/API/VisualViewport/offsetTop tags: - API - offsetTop translation_of: Web/API/VisualViewport/offsetTop ---
{{SeeCompatTable}}{{APIRef("Visual Viewport")}}
{{domxref("VisualViewport")}} 接口的只读属性 offsetTop
返回视觉视口的顶部相对于布局视口的顶部的偏移量,以CSS像素为单位。
var offsetTop = VisualViewport.offsetTop
一个双精度值。
Specification | Status | Comment |
---|---|---|
{{SpecName('Visual Viewport','#dom-visualviewport-offsettop','offsetTop')}} | {{Spec2('Visual Viewport')}} | Initial definition. |
{{Compat("api.VisualViewport.offsetTop")}}