Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

反馈:docs/components/dynamic-content/mip-position-observer.md #712

Open
ivanfjz opened this issue Oct 17, 2019 · 2 comments
Open

反馈:docs/components/dynamic-content/mip-position-observer.md #712

ivanfjz opened this issue Oct 17, 2019 · 2 comments
Assignees

Comments

@ivanfjz
Copy link

ivanfjz commented Oct 17, 2019

文档里只是举例了enter,exit事件,scroll事件该如何使用?scroll事件应该还会附带其他参数吧,能具体举个例子不,怎么使用事件附带的参数。我现在需要判断用户是往上滚还是往下滚,来动态展示或隐藏一个元素。请教下,该怎么办

@clark-t
Copy link
Contributor

clark-t commented Oct 18, 2019

您好,scroll 事件的使用方法满足 MIP on 表达式规范,可参考文档:https://www.mipengine.org/v2/docs/interactive-mip/event-and-action.html;
另外 scroll 事件会所抛出的参数可以通过 event.percent 和 event.positionObserverData 拿到,相关代码为:https://github.com/mipengine/mip2-extensions/blob/master/components/mip-position-observer/mip-position-observer.js#L378。
相关文档我们会在后续补充

@ivanfjz
Copy link
Author

ivanfjz commented Oct 19, 2019

谢谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants