YUI:页面加载后在某些事件队列的顶部添加事件?
如何在页面加载后将新事件放置在链接到对象的所有附加事件的顶部?
实际上,我有一个手风琴,使用一些 YUI 函数来激活其行为,现在在不修改 YUI 主函数的情况下,我需要一些用于调用 AJAX 例程的新函数。 目前我正在尝试使用 Event.getListeners,但我不知道如何处理返回的对象。
问候
How can I put a new event at the top of all attached events linked to an object just after the page load?
Pratically I have an accordion using some YUI funcs to activate its behavior, now without modifying the YUI main function I need some new functions used to call AJAX routines.
Currently I am trying with Event.getListeners, but I don't know how to treat the returned objects.
Regards
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从 Event.getListeners 获得的响应是传递给 Event.addListener 的所有参数。 根据 Event.getListeners 文档,它返回
因此,使用该对象,您可能可以使用 事件删除侦听器。移除监听器 & 然后使用 Event.addListener 按照您想要的顺序重新添加它们。 该对象的属性与 Event.addListener 的参数 1:1 映射,因此不会丢失任何内容。
The responses you get from Event.getListeners is all the arguments passed into the Event.addListener. According to the docs for Event.getListeners it returns
So using that object you can probably just remove the Listeners using Event.removeListener & then re-add them all in the order you want using Event.addListener. The object's properties map 1:1 with the args for Event.addListener so nothing will be lost.