Movatterモバイル変換


[0]ホーム

URL:


  1. 面向开发者的 Web 技术
  2. Web API
  3. Document
  4. Document.scrollingElement

此页面由社区从英文翻译而来。了解更多并加入 MDN Web Docs 社区。

View in EnglishAlways switch to English

Document.scrollingElement

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2016年8月.

scrollingElementDocument 的只读属性)返回滚动文档的Element 对象的引用。在标准模式下,这是文档的根元素,document.documentElement

当在怪异模式下,scrollingElement 属性返回 HTMLbody 元素(若不存在返回 null)。

语法

var element = document.scrollingElement;

示例

js
var scrollElm = document.scrollingElement;scrollElm.scrollTop = 0;

规范

Specification
CSSOM View Module
# dom-document-scrollingelement

浏览器兼容性

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2026 Movatter.jp