MozScrolledAreaChanged 编辑

The MozScrolledAreaChanged event is fired when the document view has been scrolled or resized.

Note: While you can poll the values of document.scrollWidth and document.scrollHeight to watch for changes to the document size, reading these properties can trigger document reflow, which can make them computationally expensive. This event, introduced in Gecko 1.9.2, is fired whenever either or both of these values change.

SpecificationMozilla specific
InterfaceUIEvent
BubblesYes
CancelableYes
TargetDefaultView, Document
Default ActionNone

Properties

PropertyTypeDescription
targetRead onlyEventTargetThe event target (the topmost target in the DOM tree).
typeRead onlyDOMStringThe type of event.
bubblesRead onlyBooleanWhether the event normally bubbles or not.
cancelableRead onlyBooleanWhether the event is cancellable or not.
viewRead onlyWindowProxydocument.defaultView (window of the document)
detailRead onlylong (float)0.
widthRead onlylong (int)The width of the visible region of the document.
heightRead onlylong (int)The height of the visible region of the document.
xRead onlylong (int)The X coordinate of the left edge of the visible region of the document.
yRead onlylong (int)The Y coordinate of the top edge of the visible region of the document.

Example

document.addEventListener("MozScrolledAreaChanged", event => {
    // find something useful to do with those values
    event.width;
    event.height;
    event.x;
    event.y;

}, false);

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:126 次

字数:3535

最后编辑:7 年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文