提交 4f93c8fb 编写于 作者: Q qiang

fix: IntersectionObserver 对象方法 relativeTo relativeToViewport 支持链式调用

上级 e040aec8
......@@ -20,10 +20,12 @@ class MPIntersectionObserver {
relativeTo (selector, margins) {
this.options.relativeToSelector = selector
this._makeRootMargin(margins)
return this
}
relativeToViewport (margins) {
this.options.relativeToSelector = null
this._makeRootMargin(margins)
return this
}
observe (selector, callback) {
if (typeof callback !== 'function') {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册