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.
Specification | Mozilla specific |
---|---|
Interface | UIEvent |
Bubbles | Yes |
Cancelable | Yes |
Target | DefaultView , Document |
Default Action | None |
Properties
Property | Type | Description |
---|---|---|
target Read only | EventTarget | The event target (the topmost target in the DOM tree). |
type Read only | DOMString | The type of event. |
bubbles Read only | Boolean | Whether the event normally bubbles or not. |
cancelable Read only | Boolean | Whether the event is cancellable or not. |
view Read only | WindowProxy | document.defaultView (window of the document) |
detail Read only | long (float) | 0. |
width Read only | long (int) | The width of the visible region of the document. |
height Read only | long (int) | The height of the visible region of the document. |
x Read only | long (int) | The X coordinate of the left edge of the visible region of the document. |
y Read only | long (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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论